Opened 18 years ago

Closed 17 years ago

#999 closed defect (fixed)

'bool' object has no attribute 'get' when trying to add a record

Reported by: Ian@… Owned by: Adrian Holovaty
Component: Metasystem Version: 0.91
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Request Method:  	GET
Request URL: 	http://localhost:8000/cms/admin/forum/forums/add/
Exception Type: 	AttributeError
Exception Value: 	'bool' object has no attribute 'get'
Exception Location: 	/usr/local/lib/python2.4/site-packages/django/core/meta/ in get_manipulator_fields, line 256

the model in question is here:

class Forum(meta.Model):
    category = meta.ForeignKey( Category )
    name = meta.CharField(maxlength=150, core=True)
    description = meta.TextField()
    # # of posts
    posts = meta.IntegerField()
    # # of topics 
    topics = meta.IntegerField()
    prune_it = meta.BooleanField()
    class META:                                                                                                   
        admin = meta.Admin(                                                                                       
            list_display = ('name', 'description'),                                                               

any hints?

Change History (6)

comment:1 Changed 18 years ago by ian@…

ok.. this is strange.
changing the 'posts' and 'topics' fields to post_count and topic_count fixed the issue.
nb: I also have other models called post and topic.

comment:2 Changed 18 years ago by ilikeprivacy@…

After spending forever trying to workout what was wrong... it has nothing to do with boolean fields.

As Ian wrote, it is to do with a property having the same name as the pluralised name of another class, change the property to something else and it will work correctly.

comment:3 Changed 18 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

Sounds like the issue was fixed.

comment:4 Changed 17 years ago by James Bennett

Resolution: invalid
Status: closedreopened

Reopening because it wasn't fixed :)

comment:5 Changed 17 years ago by James Bennett

Component: Admin interfaceMetasystem
Triage Stage: UnreviewedAccepted
Version: 0.91

comment:6 Changed 17 years ago by James Bennett

Resolution: fixed
Status: reopenedclosed

(In [4673]) 0.91-bugfixes: Fixed #999 by resolving name clash in the metasystem which could confuse manipulators about which fields they should follow. Refs #1808, #1826, #1839 and #2415, which are variations of this that persist in trunk.

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