-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
26 lines (22 loc) · 719 Bytes
/
Copy pathmodels.py
File metadata and controls
26 lines (22 loc) · 719 Bytes
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
from django.db import models
# Create your models here.
class Table(models.Model):
title = models.TextField()
content = models.TextField()
create_date = models.DateTimeField()
actual_date = models.DateTimeField()
columns = models.ManyToManyField('Column')
def __str__(self): return self.title
class Column(models.Model):
CHOICES = (
('b', 'Boolean'),
('i', 'Integer'),
('f', 'Float'),
('c', 'Char'),
('s', 'String'),
('d', 'DateTime')
)
name = models.TextField()
description = models.TextField()
datatype = models.CharField(max_length=1, choices=CHOICES)
def __str__(self): return self.name + " (" + self.datatype + ")"