Opened 13 years ago

Closed 13 years ago

#331 closed defect (fixed)

Unexpected model attributes crash install

Reported by: anonymous Owned by: Adrian Holovaty
Component: Tools Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Attributes in the model class that django isn't expecting cause install <foo> to crash with a particularly nondescript error (AttributeError: '<whatever>' object has no attribute 'custom'). Functions and expected non-function attributes are all parsed correctly, but it appears that when django encounters an unknown name it doesn't do type-checking (in this case, it was a tuple used as a choices argument, which can't be assigned values using

Sample model:

class Sample(meta.Model):
        (0, "Django"),
        (1, "RoR"),
        (2, "Other"),
    fields = (
        meta.IntegerField('framework', choices=Sample.FRAMEWORK_CHOICES)

nb: The problem was fixed by moving it to the module rather than the class, but it can no longer be referenced by custom functions, as they are generated in a different module.

Change History (2)

comment:1 Changed 13 years ago by anonymous

Component: Admin interfaceTools

comment:2 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

I think this is fixed at this point.

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