Opened 18 years ago

Closed 17 years ago

#2844 closed defect (wontfix)

[patch] make various field types pass member_name

Reported by: Maximillian Dornseif <md@…> Owned by: nobody
Component: Core (Other) Version: dev
Severity: minor Keywords:
Cc: md@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I was having two Model like this:

class FedasCategory(models.Model):
    id                = models.PositiveIntegerField(primary_key=True)
[...]

class Product(models.Model):
[...]
    fedas        = models.ForeignKey('FedasCategory', raw_id_admin=True, null=True, blank=True,
                   help_text='FEDAS Warenklassifikation.')   

This thre an exception in admin unless I removed "raw_id_admin=True" or changed PositiveIntegerField to IntegerField. Some investigation showed that forms/__init__.py some field types thake an parameter member_name and some don't. I'm nut sure about the rationale behind this but I suspect it is an error. Changing the *Integer fields and make them pass member_name to their superclass solved my problems. Get a patch at http://c0re.23.nu/c0de/misc/django-3881-field_member_name.diff

I'm not really sure about the member_name thing and I'm not really sure I'm fixing the right thing but I suspecct other fields like FloatField, LargeTextField and EmailField should also accept the member_name parameter in their constructor.

Change History (2)

comment:1 by jaywgraves@…, 17 years ago

This bit me also. I know 'oldforms' is going away soon, so I just changed my model to use an IntegerField as explained above.

comment:2 by Chris Beaven, 17 years ago

Resolution: wontfix
Status: newclosed

Closing because this is oldforms. If someone really wants it, provide a patch and reopen

Note: See TracTickets for help on using tickets.
Back to Top