Re: custom widgets: passing data between widget/field/form/model

2011-10-21 Thread Aljoša Mohorović
any other comments/suggestions on this? Aljosa -- 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 django-users+unsubscr...@googlegro

Re: custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Aljoša Mohorović
On Wed, Oct 19, 2011 at 1:21 PM, Tom Evans wrote: > I suggest you rethink your approach. Subclassing ForeignKey so that > you can build a better widget does not seem sane. Why do you think > this would help? because the simplest way to make it reusable is to have "from myapp.fields MyCustomField"

Re: custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Tom Evans
On Wed, Oct 19, 2011 at 12:05 PM, Aljoša Mohorović wrote: > i'm subclassing ForeignKey but can't figure out howto access actual > instance (model data). > if i'm doing "class MyField(ForeignKey)", what do i need to override, > which MyField method, where i have access to related instance data (or

custom widgets: passing data between widget/field/form/model

2011-10-19 Thread Aljoša Mohorović
i'm subclassing ForeignKey but can't figure out howto access actual instance (model data). if i'm doing "class MyField(ForeignKey)", what do i need to override, which MyField method, where i have access to related instance data (or None if it doesn't exists)? digging through the code i've found "s