Malcolm Tredinnick wrote:
> You're not really providing enough information that I can make concrete
> suggestions here. How would the "focus" of the more restricted selection
> set be determined? The standard options are...
>
> (1) If it's something you can work out from other, previously filled in
> fields on the page, then you could use the 'js' option in the Admin
> class to add some custom Javascript. See [1] for some useful posts about
> this possibility.
>
> (2) If you want something more interactive and customised, such as
> clicking on a map or specifying the general area prior to entering any
> details, then you can write your own form for input. The admin interface
> provides a reasonably generic input form that works for many cases up to
> a point. But once you want custom input, particularly for slightly
> unwieldy data constructs or sizes, it often pays to just knock up a
> quick custom input form and do it yourself.
>
>
> [1] http://groups.google.com/group/django-users/search?q=Admin+js
> +option&start=0&scoring=d&
>
> Hope this provides you with some food for thought.

Hi Malcolm,
  I was trying to achieve option one for this project.  Essentially, I
would like to provide the user with the ability to assign a specific
location for each job by selecting a Country, State, & City.  In my
original model I was trying to manipulate the dynamically generated
Admin interface with my model so that it would allow me to filter the
options presented to the user based on the relationships in the model.
After implementing your initial suggestions I was able to create a
situation where the user could easily select a City that had a Country
and State based on there relationships in the model.  The down side of
this approach is that when I add all of the possible locations, the
user would have a list with thousands of options.  This wouldn't be
very user friendly, so I need to be able to narrow down the
possibilities as follows:

  Country: (A drop down list of countries)
             - United States
             - Canada
             - Etc.

  State: (A drop down list of states based on the previous country
selection)
             + United Sates
                - Would provide: Wyoming, Colorado, Kansas, Etc.

             + Canada
                - Would provide: Alberta, British Columbia, Manitoba,
Etc.

  City: (A drop down list of cities based on the previous Country and
State selections)
             + Wyoming
               - Would provide: Cheyenne, Laramie, Casper, Etc.

             + Colorado
                - Would provide: Denver, Ft. Collins, Greeley, Etc.

              + Kansas
                - Would provide: Lawrence, Kansas City, Salina, Etc.

              + Alberta
                - Would provide: Beaumont, Bonnyville, Provost, Etc.

              + And so on...


  At this point the 'js' option in the Admin is the obvious choice for
this problem.  Here is what I currently have in mind:
    - Revert my job model so that it has a column for Country, State, &
City.
    - Utilized the 'js' option in the Admin with the appropriate 'js'
script to provide the functionality in my example above.

Many Thanks!
--Nick


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to