gabor wrote:
> up to now i simply added raw_id_admin = True to the model's field, but 
> now i do not know how it should be handled...i realize that the 
> new-admin is probably using the newforms... and i do not know how 
> raw_id_admin is handled there

I was thinking of it a bit... My first solution was to create a custom 
manipulator that was switching off those huge <select>s with 'follow'. 
In newforms this can be achieved by specifying for ForeignKeys a simpler 
widget like HiddenInput. But the main problem with this solution is that 
you need to create a new form subclass just to say "I won't display this 
field" which is 1) an overkill and 2) doesn't work in cases where form 
is created automatically (generic views).

I have a better proposal. We can just defer getting 'choices' for 
<select> until 'render' is called. Thus if the field is never displayed 
in template it won't hit database. I'm not sure how to do it properly 
though... I see two ways now:

- Turn Field.get_choices into a generator. It now actually fetches rows 
and wraps them into a list and adds a 'blank' choice.
- Allow a callable in 'choices' param of a Select widget that will be 
called on 'render'. It then can be passed as lambda calling form's choices.

I better like first option. What do you think?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to