Code

Opened 9 years ago

Closed 9 years ago

#331 closed defect (fixed)

Unexpected model attributes crash install

Reported by: anonymous Owned by: adrian
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:

Description

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).

Sample model:

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.

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by anonymous

  • Component changed from Admin interface to Tools

comment:2 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

I think this is fixed at this point.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.