Changes between Initial Version and Version 2 of Ticket #6805
- Timestamp:
- Mar 17, 2008, 9:48:48 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #6805 – Description
initial v2 1 1 This call will generate an exception because the content_object is not found as field 2 {{{ 3 #!python 2 4 >>> Property.objects.get_or_create(name=property_name, content_object=self) 3 5 … … 7 9 The last line of the exception is interesting: 8 10 TypeError: Cannot resolve keyword 'content_object' into field. Choices are: anexampleowner, resource, id, name, content_type, object_id 11 }}} 9 12 10 13 It seems that, for some reason, here the variable referring to AnExampleOwner class has been named after the class, i.e. … … 12 15 13 16 Hee is the code: 14 17 {{{ 18 #!python 15 19 class Property(models.Model): 16 20 name = models.CharField(max_length=200)#, core=True) … … 62 66 raise TypeError, "Cannot resolve keyword '%s' into field. Choices are: %s" % (name, ", ".join(choices)) 63 67 TypeError: Cannot resolve keyword 'content_object' into field. Choices are: anexampleowner, resource, id, name, content_type, object_id 64 65 ‣ About this site 66 67 68 69 68 }}} 70 69 71 70 Also on http://dpaste.com/39871/