Hi everyone.  I'm quite new to Django and have been using the web
tutorials as well as the two Django books extensively.  If have tried
searching for a solution to my problem, but in truth, I barely know
how to ask, so I'll explain the scenario as briefly as possible.

I'm building a document tracker for a global, highly-regulated
industry.  Here are my models (briefly summarized).

Study - Each study takes place in many different countries, each with
their own requirements.  Countries will be added to the study via a
ManyToMany relationship.

Country - Each country has several Agencies that must grant approval.
These agencies are unique to a country (no agency operates in two
countries).  Agencies are added with a ForeignKey relationship.

Agency - Each agency requires a specific set of documents in order to
grant approval.  The documents may or may not be unique (it is
possible for two countries to require the same document).  Documents
are added to this model with a ManyToMany relationship.

Document - Each possible document is listed in this model.  Agencies
select their documents from this list, and cannot require documents
not in this list.

That's all well and good, but my problem it this: Because each study
takes place in different countries, different agencies must be applied
to which require different documents, and therefore each study will
have its own unique set of documents that must be tracked.  I need to
somehow create a unique set of documents that is shared amongst the
countries and agencies of that study ('shared' meaning that if a
document is created for that study, it is available to all agencies
for that study, but only for that study.  The same document created
for a different study would not be connected to this document).  This
set must have the ability to be altered and tracked without affecting
the master list of documents and that is unique to this study.

If I were writing my own code and using objects instead of models, it
would look like this:

required_docs = []

for country in study.countries:
____for agency in country.agencies:
________for document in agency.documents:
____________required_docs.append(document)

Each study would then have a required_docs which could be adjusted
independently of all other studies.  But I don't know how that would
look in Django!  :)

I'm pretty good at learning stuff on my own, so if anyone could even
point me in the right direction, I would appreciate it.  Maybe this is
a common problem, I don't now, but I'm stumped.

Thanks in advance.
Robert

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to