1054 Unknown column content_type_id in field list django 1.7b1

244 views
Skip to first unread message

maxwell

unread,
Apr 8, 2014, 8:50:30 AM4/8/14
to django...@googlegroups.com
Hi.

I'm using django 1.7b1. And I made generic relation in my models:

class Transaction(models.Model):
    ...

    # Generic foreign key
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = GenericForeignKey('content_type', 'object_id')


class Document(models.Model): 
... 
transactions = GenericRelation(Transaction)
and admin.py:
 class TransactionInline(GenericTabularInline):
    model = Transaction
    formfield_overrides = {
        models.TextField: {'widget': forms.Textarea(attrs={'cols': 40,
                                                           'rows': 2})}
    }

@admin.register(Document)
class DocumentAdmin(admin.ModelAdmin):
   ...
    inlines = [
        TransactionInline,
    ] 


Can you suggest where the problem may be? I have some similar fields in my old project (django 1.6) and all works fine.
 

maxwell

unread,
Apr 8, 2014, 9:00:02 AM4/8/14
to django...@googlegroups.com
The error occurs on record save in django admin. 
Reply all
Reply to author
Forward
0 new messages