OperationalError at / in django

96 views
Skip to first unread message

Remaze Vs

unread,
Aug 19, 2015, 7:23:56 AM8/19/15
to Django developers (Contributions to Django itself)
I am new in django..error like  no such column: products_product.User_id_id

model.py

from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User

class Product(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(null=True, blank=True)
category = models.ManyToManyField(Category, null=True, blank=True)
price = models.DecimalField(decimal_places=2, max_digits=100, default=29.99)
sale_price = models.DecimalField(decimal_places=2, max_digits=100,\
null=True, blank=True)
slug = models.SlugField(unique=True)
timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
updated = models.DateTimeField(auto_now_add=False, auto_now=True)
active = models.BooleanField(default=True)
update_defaults = models.BooleanField(default=False)
User_id = models.ForeignKey(User)


view.py

class DealsForm(ModelForm):
    class Meta:
        model = Product
        fields = ['title','description','category','price','sale_price','slug','active','update_defaults','User_id']





Tim Graham

unread,
Aug 19, 2015, 8:54:57 AM8/19/15
to Django developers (Contributions to Django itself), rema...@gmail.com
Hi, if you're looking for help on how to use Django, you should post to the django-users mailing list. This list is for discussing the development of Django itself. Thanks!
Reply all
Reply to author
Forward
0 new messages