Unexpected model attributes crash install
|Reported by:||anonymous||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Attributes in the model class that django isn't expecting cause djangoadmin.py 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 foo.bar).
class Sample(meta.Model): FRAMEWORK_CHOICES = ( (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.