Changes between Initial Version and Version 1 of Ticket #20279


Ignore:
Timestamp:
04/17/2013 03:40:44 PM (2 years ago)
Author:
charettes
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20279

    • Property Status changed from new to closed
    • Property Patch needs improvement unset
    • Property Component changed from Uncategorized to contrib.contenttypes
    • Property Needs tests unset
    • Property Needs documentation unset
    • Property Resolution changed from to needsinfo
  • 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