Changes between Initial Version and Version 1 of Ticket #20279


Ignore:
Timestamp:
Apr 17, 2013, 3:40:44 PM (11 years ago)
Author:
Simon Charette
Comment:

Please re-open with the full traceback and use WikiFormating when providing code samples.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20279

    • Property Component Uncategorizedcontrib.contenttypes
    • Property Resolutionneedsinfo
    • Property Status newclosed
  • Ticket #20279 – Description

    initial v1  
    1 while I used field names item_type, item_id instead of content_type, object_id.
    2 to reference an object. and while delete the object, it will raise exception.
     1While I used field names `item_type`, `item_id` instead of `content_type`, `object_id` to reference an object. and while delete the object, it will raise exception.
    32
    43For example:
    54
     5{{{
     6#!python
    67class ObjectPermission(models.Model):
    78    # implement object/row based permission
     
    1718class Publisher(models.Model):
    1819    name = models.CharField(max_length=255)
     20}}}
    1921
    2022I create an relation between publisher and object permission.
    2123while delete a publisher in django admin, it will raise fielderror,
    2224
     25{{{
    2326at query.py line 1320
    2427raise FieldError("Cannot resolve keyword object into field. "
    2528                            "Choices are: %s" % (name, ", ".join(names)))
    26 
     29}}}
    2730and after I change the field name back to content_type, object_id,
    2831the exception won't appear.
Back to Top