Opened 10 years ago

Closed 9 years ago

#999 closed defect (fixed)

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

Reported by: Ian@… Owned by: adrian
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: UI/UX:


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 10 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 10 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 10 years ago by adrian

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

Sounds like the issue was fixed.

comment:4 Changed 9 years ago by ubernostrum

  • Resolution invalid deleted
  • Status changed from closed to reopened

Reopening because it wasn't fixed :)

comment:5 Changed 9 years ago by ubernostrum

  • Component changed from Admin interface to Metasystem
  • Triage Stage changed from Unreviewed to Accepted
  • Version set to 0.91

comment:6 Changed 9 years ago by ubernostrum

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

(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