NOT NULL约束失败:permission_portal_task.user_id

时间:2014-10-07 17:12:33

标签: django django-models django-forms django-admin

from django.db import models
from django.contrib.auth.models import User,Group,Permission
from django.utils import timezone
# Create your models here.

class Role(models.Model):
    name=models.CharField(max_length=128)
    display_name=models.CharField(max_length=255)
    description=models.TextField()
    def __str__(self):
        return self.name

class Task(models.Model):
    user = models.ForeignKey(User, unique=True)
    name=models.CharField(max_length=255)
    description=models.TextField(default='Description')
    approoved = models.BooleanField(default=False)
    def __str__(self):
        return self.name

我无法链接角色和任务数据库。获取错误" NOT NULL约束失败:permission_portal_task.user_id"

0 个答案:

没有答案