Hello omerd --

If you give some concrete examples of what you are trying to do,
including providing your current models.py code, it will make it
easier for us to help you.

Since you have Registration and Details models, I am assuming you want
the user to be able to create/define these items, rather than
specifying them yourself beforehand. So if I am a user of your system,
I can define a new Registration for handguns, and indicate that I want
Details of caliber and shell capacity. Then another user can access
the system and register his .38 six-shooter. Is that the kind of thing
you have in mind? If so, you are essentially giving the users the
ability to define a new table (Registration) with certain columns
(Details), and then letting them populate it (and you would store the
actual values using another model like 'AttributeValue').

On the other hand, if you are defining the subjects beforehand as the
developer, you will want a different approach altogether. In that case
you might consider something like model inheritance (https://
docs.djangoproject.com/en/1.3/topics/db/models/#model-inheritance) or
some other technique to keep things DRY as you add dozens of
registration subjects.


Hope that helps,

--Stuart

On Oct 14, 6:53 am, omerd <ome...@gmail.com> wrote:
> Hello everybody,
> I am writing my first web application with Django.
>
> I want to create a web of registration for many subjects.
> However, each subject require different set of details to be supplied
> so I don't know which models should I have in the database.
>
> Currently I have two models:
> Registration - describes a registration (each record is a different
> subject)
> Details - describes all the possible details which may be necessary to
> register.
>
> Now, each Registration instance should contain a list of the necessary
> details, so i guess that Registration and Details are Many-To-Many
> connected.
>
> My question is - how the other model(s) which contains the actual
> details and a FK to Registration model should look like? I don't want
> to create a new model for each Registration record and place the
> necessary details hardcoded in the model fields. What if I have 30
> records in Registration table ?!

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to