Django

Code

Ticket #999 (closed: fixed)

Opened 3 years ago

Last modified 1 year ago

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

Reported by: Ian@holsman.net Assigned to: adrian
Milestone: Component: Metasystem
Version: 0.91 Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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?

Attachments

Change History

12/05/05 17:19:17 changed by ian@holsman.net

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.

02/16/06 22:47:50 changed by ilikeprivacy@gmail.com

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.

02/18/06 16:16:29 changed by adrian

  • status changed from new to closed.
  • resolution set to invalid.

Sounds like the issue was fixed.

03/07/07 11:01:38 changed by ubernostrum

  • status changed from closed to reopened.
  • resolution deleted.

Reopening because it wasn't fixed :)

03/07/07 11:01:52 changed by ubernostrum

  • version set to 0.91.
  • component changed from Admin interface to Metasystem.
  • stage changed from Unreviewed to Accepted.

03/07/07 11:03:44 changed by ubernostrum

  • status changed from reopened to closed.
  • resolution set to fixed.

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


Add/Change #999 ('bool' object has no attribute 'get' when trying to add a record)




Change Properties
Action