formfield_for_foreignkey: how to know if we are modifyng an entry

2010-06-26 Thread drakkan
Hi, I'm customizing the django admin and I need to do a particular filter for a foreign key if I'm modifying a model, I'm using the following method, it works but it seems to me an hack, is there a better way to do the same thing? def formfield_for_foreignkey(self, db_field, request, **kwargs):

Re: formfield_for_foreignkey: how to know if we are modifyng an entry

2010-06-27 Thread Walt
I'm not sure if it works in this context but have you tried self.instance.id? Walt -~ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send ema

Re: formfield_for_foreignkey: how to know if we are modifyng an entry

2010-06-27 Thread drakkan
On 27 Giu, 18:00, Walt wrote: > I'm not sure if it works in this context but have you tried > self.instance.id? No it doesn't work in my context, other ideas? > > Walt > > -~ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro