This repository has been archived by the owner on Apr 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sprint_one_models.py
166 lines (135 loc) · 5.32 KB
/
sprint_one_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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
from django.db import models
from polymorphic import PolymorphicModel
from django.contrib.auth.models import User
'''This needs to go towards the top'''
class LegalEntity(models.Model):
given_name = models.TextField(max_length=30)
creation_date = models.DateField()
address1 = models.TextField(max_length=50)
address2 = models.TextField(max_length=50)
city = models.TextField(max_length=20)
state = models.CharField(max_length=2)
zip = models.IntegerField(max_length=5)
email = models.TextField(max_length=100)
'''Needs to go before InventoryImage'''
class Photograph(models.Model):
image = models.ImageField()
Date = models.DateField()
Place = models.TextField(max_length=100)
person_id = models.ForeignKey('Person')
'''Needs to go before Inventory'''
class InventoryImage(models.Model):
caption = models.TextField(max_length=300)
photograph_id = models.ForeignKey('Photograph')
'''This needs to go towards the top'''
class Inventory(PolymorphicModel):
name = models.TextField(max_length=30)
description = models.TextField(max_length=300)
value = models.DecimalField(max_digits=10, decimal_places=2)
inventory_image_id = models.ForeignKey('InventoryImage')
legal_entity_id = models.ForeignKey('LegalEntity')
'''This needs to go towards the top'''
class Person(LegalEntity):
family_name = models.TextField(max_length=30)
user = models.OneToOneField(User)
'''This needs to go towards the top'''
class Product(Inventory):
category = models.TextField(max_length=50)
'''This needs to go towards the top'''
class Item(Inventory):
standard_rental_price = models.DecimalField(max_digits=10, decimal_places=2)
'''This needs to go towards the top'''
class Return(models.Model):
return_time = models.DateTimeField()
fees_paid = models.BooleanField()
class Organization(LegalEntity):
organization_type = models.TextField(max_length=50)
person_id = models.ForeignKey('Person')
class Phone(models.Model):
extension = models.IntegerField(max_length=6)
phone_type = models.TextField(max_length=50)
legal_entity_id = models.ForeignKey('LegalEntity')
class BulkDetail(models.Model):
quantity = models.IntegerField(max_length=10)
price = models.DecimalField(max_digits=10, decimal_places=2)
class Payment(models.Model):
CARD_CHOICES = (
('v', 'Visa'),
('a', 'American Express'),
('m', 'Master Card'),
('d', 'Discover Card')
)
card_name = models.TextField(max_length=100)
card_type = models.CharField(max_length=1, choices=CARD_CHOICES, default='v')
card_number = models.IntegerField(max_length=15)
class BulkProduct(Product):
quantity = models.IntegerField(max_length=10)
class IndividualProduct(Product):
date_made = models.DateField()
order_id = models.ForeignKey('Order', null=True)
class PersonalProduct(Product):
order_form_name = models.TextField(max_length=30)
prodction_time = models.DateTimeField()
class PersonalDetail(models.Model):
order_file = models.TextField(max_length=30)
class Event(models.Model):
start_date = models.DateField()
end_date = models.DateField()
class Venue(models.Model):
name = models.TextField(max_length=50)
address = models.TextField(max_length=100)
city = models.TextField(max_length=30)
state = models.CharField(max_length=2)
zip = models.IntegerField(max_length=5)
email = models.TextField(max_length=100)
event_id = models.ForeignKey('Event')
class EventType(models.Model):
name = models.TextField(max_length=50)
description = models.TextField(max_length=300)
event_id = models.ForeignKey('LegalEntity', null=True)
class Agent(Person):
appointment_date = models.DateTimeField()
class RentableItem(Item):
is_rentable = models.BooleanField()
class WardrobeItem(Item):
size = models.FloatField()
size_modifier = models.TextField(max_length=100)
gender = models.CharField(max_length=1)
color = models.TextField(max_length=10)
pattern = models.TextField(max_length=50)
start_year = models.DateField()
end_year = models.DateField()
note = models.TextField(max_length=500)
class Order(models.Model):
order_date = models.DateField()
phone = models.IntegerField(max_length=15)
date_packed = models.DateField()
date_paid = models.DateField()
date_shipped = models.DateField()
tracking_number = models.IntegerField(max_length=50)
agent_id = models.ForeignKey('Agent', null=True)
class Area(models.Model):
name = models.TextField(max_length=50)
description = models.TextField(max_length=300)
place_number = models.IntegerField(max_length=4)
agent_id = models.ForeignKey('Agent')
event_id = models.ForeignKey('Event')
class RentedItem(models.Model):
condition = models.TextField(max_length=500)
new_damage = models.TextField(max_length=500)
damage_fee = models.DecimalField(max_digits=10, decimal_places=2)
late_fee = models.DecimalField(max_digits=10, decimal_places=2)
return_id = models.ForeignKey('Return', null=True)
class SaleItem(models.Model):
name = models.TextField(max_length=50)
description = models.TextField(max_length=300)
low_price = models.DecimalField(max_digits=10, decimal_places=2)
high_price = models.DecimalField(max_digits=10, decimal_places=2)
sale_item_id = models.ForeignKey('Area')
class InventoryPhotograph(models.Model):
caption = models.TextField(max_length=300)
class BulkDetail(models.Model):
quantity = models.IntegerField(max_length=6)
price = models.DecimalField(max_digits=10, decimal_places=2)
class PersonalDetail(models.Model):
order_file = models.FileField()