-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
31 lines (28 loc) · 1.1 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django.db import models
from datetime import datetime
COLOR_CHOICES = (
('white', 'White'),
('yellow', 'Yellow'),
('red', 'Red'),
('blue', 'Blue'),
('orange', 'Orange'),
('green', 'Green')
)
class Widget(models.Model):
name = models.CharField(max_length=255)
title = models.CharField(max_length=255)
description = models.CharField(max_length=255, null=True)
enabled = models.BooleanField(default=True)
icon = models.CharField(max_length=255, null=True)
color = models.CharField(max_length=255, default='white', choices=COLOR_CHOICES)
movable = models.BooleanField(default=True)
removable = models.BooleanField(default=True)
editable = models.BooleanField(default=False)
refreshable = models.BooleanField(default=False)
refreshUrl = models.CharField(max_length=255, null=True)
column = models.IntegerField(default=1)
order = models.IntegerField(default=0)
created_time = models.DateTimeField(default=datetime.now())
updated_time = models.DateTimeField(default=datetime.now())
def __unicode__(self):
return self.name