-
Notifications
You must be signed in to change notification settings - Fork 0
/
classDefinitions.py
90 lines (68 loc) · 2.92 KB
/
classDefinitions.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from django.db import models
#Authors authorID firstName lastName
#This will create and Auto-Incrementing ID primary key!
class Author(models.Model):
authorID = models.CharField(max_length=50)
lastName = models.CharField(max_length=50)
firstName = models.CharField(max_length=50)
#Blog blogId authorID title subtitle editor
#This will create and Auto-Incrementing ID primary key!
class Blog(models.Model):
blogId = models.CharField(max_length=50)
authorID = models.ForeignKey(Author, related_name='authorID')
title = models.CharField(max_length=120)
subtitle = models.CharField(max_length=120)
editor = models.ForeignKey(Author, blank=True, related_name='authorID')
#Article articleId title subtitle authorId body sources
class Article(models.Model):
articleId = models.CharField(max_length=140)
title = models.Charfield(max_length=256)
subtitle = models.Charfield(max_length=256)
authorId = models.ForeignKey(Author, related_name='authorID')
body = model.TextField()
sources = models.TextField()
#Updates authorID articleID timestamp
#This will create and Auto-Incrementing ID primary key!
class Updates(models.Model):
authorID = models.ForeignKey(Author, related_name='authorID')
articleID = models.ForeignKey(Article, related_name='articleId')
timestamp = models.TimeField()
#Review reviewId title subtitle body score datePosted productId
class Review(models.Model)
reviewId = models.CharField(max_length=256)
title = models.CharField(max_length=256)
subtitle = models.CharField(max_length=256)
body = models.TextField()
score = models.CharField(max_length=256)
datePosted = models.DateField()
productId = models.CharField(max_length=256)
#Media mediaId title subtitle authorId type location
class Media(models.Model)
mediaId = model.CharField(max_length=256)
title = models.CharField(max_length=256)
subtitle = models.CharField(max_length=256)
authorID = models.ForeignKey(Author, related_name='authorID')
mediaType = models.CharField(max_length=256)
location = models.CharField(max_length=256)
#Tutorial tutorialId title subtitle authorId body productId
class Tutorial(models.Model)
tutorialId = models.CharField(max_length=256)
title = models.CharField(max_length=256)
subtitle = models.CharField(max_length=256)
authorID = models.ForeignKey(Author, related_name='authorID')
body = models.TextField()
productId = models.CharField(max_length=256)
#FavoriteLink authorID title description URL
class FavoriteLink(models.Model)
authorID = models.ForeignKey(Author, related_name='authorID')
title = models.CharField(max_length=256)
description = models.TextField()
URL = models.CharField(max_length=256)
#Bio authorID title subtitle body hometown hobbies
class Bio(models.Model):
authorID = models.ForeignKey(Author, related_name='authorID')
title = models.CharField(max_length=256)
subtitle = models.CharField(max_length=256)
body = models.TextField()
hometown = models.CharField(max_length=50)
hobbies = models.TextField()