Re: Foreign key with tons of items

2008-10-28 Thread Frank Malina @ vizualbod.com
Use "raw_id_field" useful when you have a Foreign Key on another model with lots of records. This changes the default interface from the a select box to a custom widget --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Foreign key with tons of items

2008-10-28 Thread Steve Holden
Fabio Natali wrote: > gearheart wrote: > >> maybe limit_choices_to is what you're looking for >> i had similar problem and solved with ajax autocomplete widget. >> > > I haven't yet get rid of those too-much-long inline drop down menus. > > I was thinking to use js to open up a window and

Re: Foreign key with tons of items

2008-10-28 Thread Fabio Natali
gearheart wrote: > maybe limit_choices_to is what you're looking for > i had similar problem and solved with ajax autocomplete widget. I haven't yet get rid of those too-much-long inline drop down menus. I was thinking to use js to open up a window and let the user choose from some hyerarchical

Re: Foreign key with tons of items

2008-10-27 Thread gearheart
maybe limit_choices_to is what you're looking for i had similar problem and solved with ajax autocomplete widget. On Oct 27, 1:47 pm, paolofdr <[EMAIL PROTECTED]> wrote: > Hello everybody, > I have a similar problem: a too long drop-down menu inside an inline > element in the admin page. > Is it

Re: Foreign key with tons of items

2008-10-27 Thread paolofdr
Hello everybody, I have a similar problem: a too long drop-down menu inside an inline element in the admin page. Is it possible to limit the items displayed in the drop-down list, filtering them by the value of other fields? Thank you Paolo On 23 Ott, 18:37, Fabio Natali <[EMAIL PROTECTED]> wro

Re: Foreign key with tons of items

2008-10-26 Thread Fabio Natali
Dear Lars, thank you very much for your kind and fast reply. Lars Stavholm wrote: [...] > Have you tried filter_horizontal? > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#filter-horizontal I am not sure I can really use filter_horizontal in my scenario. The actual structure I am using

Re: Foreign key with tons of items

2008-10-23 Thread Lars Stavholm
Fabio Natali wrote: > Fabio Natali wrote: > [...] >> class Prod2(models.Model): >> name = models.CharField(max_length=30) >> >> class Prod1(models.Model): >> name = models.CharField(max_length=30) >> belongs_to = models.ForeignKey(Prod2) >> >> class Prod0(models.Model): >> name = m

Re: Foreign key with tons of items

2008-10-23 Thread Fabio Natali
Fabio Natali wrote: [...] > class Prod2(models.Model): > name = models.CharField(max_length=30) > > class Prod1(models.Model): > name = models.CharField(max_length=30) > belongs_to = models.ForeignKey(Prod2) > > class Prod0(models.Model): > name = models.CharField(max_length=30)

Foreign key with tons of items

2008-10-23 Thread Fabio Natali
Hi everybody. In my admin page I have a field for a foreign key with hundreds of items. That results in a drop down menu which is very difficult and annoying to use. This is my models.py: class Prod2(models.Model): name = models.CharField(max_length=30) class Prod1(models.Model): name