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

Description

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/__init__.py 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 by ian@…, 18 years ago

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 by ilikeprivacy@…, 18 years ago

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 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

Sounds like the issue was fixed.

comment:4 by James Bennett, 17 years ago

Resolution: invalid
Status: closedreopened

Reopening because it wasn't fixed :)

comment:5 by James Bennett, 17 years ago

Component: Admin interfaceMetasystem
Triage Stage: UnreviewedAccepted
Version: 0.91

comment:6 by James Bennett, 17 years ago

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