I'll describe what I think is an unaddressed area. I may be
misinformed. Everyone seems to have different ways of talking about
this type of situation. The solution may be a new feature or simply a
design pattern. There may already be a technique I am unaware of...

Consider an application with models for each of the
following(US-centric. Internationals will have to mentally translate)-
State, County, Postal Code and User. Assume that there are
properly-defined foreign key relationships between these models. There
are about 43,000 postal zip codes in use in the US today(I found it on
the Internet, so it must be true!). Clearly, when we create a new user
in the admin, we cannot simply present a list of 43,000 elements to
select from. As Django goes public, it will be increasingly used as a
general-purpose web application framework and this sort of dataset is
not uncommon.

Django already knows from the model definitions that 'zipcode' has a
foreign key to 'county' and that 'county' has a foreign key to 'state'.
If we had some way to indicate which fields were to be used, we could
add additional fields to the 'create user' form that would only be used
to alter the contents of the selection list for the actual field in
question.

In the Admin UI it could look like this:

[Select State]
--[Select County]
----[Select Zip]

To reiterate - the 'state' and 'county' values would not be stored in
the database. They would only limit the selection of the 'zip' field.

I have done this sort of thing in Javascript on non-framework sites
before. It seems wrong to re-implement this outside of the admin, since
all the information about the models and their relationships have
already been described.

Could someone familiar with the admin give some feedback about the
possibility of something like this happening? It doesn't seem like this
would be a huge amount of work to implement. How wrong am I?


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

Reply via email to