Changes between Initial Version and Version 2 of Ticket #6805


Ignore:
Timestamp:
Mar 17, 2008, 9:48:48 PM (16 years ago)
Author:
Malcolm Tredinnick
Comment:

Fixed description formatting.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6805 – Description

    initial v2  
    11This call will generate an exception because the content_object is not found as field
     2{{{
     3#!python
    24>>> Property.objects.get_or_create(name=property_name, content_object=self)
    35
     
    79The last line of the exception is interesting:
    810TypeError: Cannot resolve keyword 'content_object' into field. Choices are: anexampleowner, resource, id, name, content_type, object_id
     11}}}
    912
    1013It seems that, for some reason, here the variable referring to AnExampleOwner class has been named after the class, i.e.
     
    1215
    1316Hee is the code:
    14 
     17{{{
     18#!python
    1519class Property(models.Model):
    1620    name = models.CharField(max_length=200)#, core=True)
     
    6266        raise TypeError, "Cannot resolve keyword '%s' into field. Choices are: %s" % (name, ", ".join(choices))
    6367    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}}}
    7069
    7170Also on http://dpaste.com/39871/
Back to Top