from django.db import models

class View(models.Model):
    name = models.CharField(unique=False, max_length=64)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)
    description = models.CharField(max_length=256)
    state = models.CharField(choices=(('create', '创建'), ('work', '运行'), ('done', '完成')), max_length=10)
    user = models.ForeignKey(to="api.User", on_delete=models.CASCADE, related_name='own_views')
  
    class Meta:
        app_label = 'api'