Re: Custom model field as foreign key

2012-06-21 Thread Melvyn Sopacua
On 20-6-2012 19:38, Melvyn Sopacua wrote: > On 19-6-2012 17:02, Kurtis Mullins wrote: >> hmm, maybe you need a custom Select Widget for your custom field? Or check >> out the select widget and see if it's looking for any _meta information on >> the field that determines how the widget is displayed.

Re: Custom model field as foreign key

2012-06-20 Thread Melvyn Sopacua
On 19-6-2012 17:02, Kurtis Mullins wrote: > hmm, maybe you need a custom Select Widget for your custom field? Or check > out the select widget and see if it's looking for any _meta information on > the field that determines how the widget is displayed. I traced this down to the ModelForm() getting

Re: Custom model field as foreign key

2012-06-19 Thread Kurtis Mullins
hmm, maybe you need a custom Select Widget for your custom field? Or check out the select widget and see if it's looking for any _meta information on the field that determines how the widget is displayed. On Tue, Jun 19, 2012 at 8:49 AM, Melvyn Sopacua wrote: > On 19-6-2012 14:45, Juan Pablo Mart

Re: Custom model field as foreign key

2012-06-19 Thread Melvyn Sopacua
On 19-6-2012 14:45, Juan Pablo Martínez wrote: > You saw this? > > https://docs.djangoproject.com/en/dev/howto/custom-model-fields/#django.db.models.Field.to_python Yes, that's not the issue. I've implemented to_python and get_prep_* and everything goes ok, until the field gets used as Foreignkey

Re: Custom model field as foreign key

2012-06-19 Thread Juan Pablo Martínez
You saw this? https://docs.djangoproject.com/en/dev/howto/custom-model-fields/#django.db.models.Field.to_python On Tue, Jun 19, 2012 at 9:38 AM, Melvyn Sopacua wrote: > Hi, > > When using a custom field as primary key, and subsequently as a > ForeignKey the database representation gets stored as

Custom model field as foreign key

2012-06-19 Thread Melvyn Sopacua
Hi, When using a custom field as primary key, and subsequently as a ForeignKey the database representation gets stored as the related value on the object. This is a problem when it has to match the selected value in a form and the documentation doesn't provide any clues where I should be overridin