1
|
# This is an auto-generated Django model module.
|
2
|
# You'll have to do the following manually to clean this up:
|
3
|
# * Rearrange models' order
|
4
|
# * Make sure each model has one field with primary_key=True
|
5
|
# Feel free to rename the models, but don't rename db_table values or field names.
|
6
|
#
|
7
|
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
|
8
|
# into your database.
|
9
|
|
10
|
from django.db import models
|
11
|
|
12
|
class Activity(models.Model):
|
13
|
id = models.IntegerField(primary_key=True)
|
14
|
school_id = models.IntegerField()
|
15
|
user_id = models.IntegerField(null=True, blank=True)
|
16
|
description = models.CharField(max_length=6000)
|
17
|
timestamp = models.DateTimeField(null=True, blank=True)
|
18
|
end_timestamp = models.DateTimeField(null=True, blank=True)
|
19
|
class Meta:
|
20
|
db_table = u'activity'
|
21
|
|
22
|
class AlarmDefinition(models.Model):
|
23
|
id = models.IntegerField(primary_key=True)
|
24
|
user_id = models.IntegerField()
|
25
|
description = models.CharField(max_length=600)
|
26
|
code = models.CharField(max_length=6000)
|
27
|
active = models.IntegerField()
|
28
|
local = models.IntegerField()
|
29
|
class Meta:
|
30
|
db_table = u'alarm_definition'
|
31
|
|
32
|
class AlarmDefinitionRun(models.Model):
|
33
|
id = models.IntegerField(primary_key=True)
|
34
|
school_id = models.IntegerField(unique=True)
|
35
|
definition_id = models.IntegerField()
|
36
|
school_timestamp = models.FloatField(null=True, blank=True)
|
37
|
class Meta:
|
38
|
db_table = u'alarm_definition_run'
|
39
|
|
40
|
class Alarms(models.Model):
|
41
|
id = models.IntegerField(primary_key=True)
|
42
|
host_id = models.IntegerField()
|
43
|
definition_id = models.IntegerField(null=True, blank=True)
|
44
|
description = models.CharField(max_length=600)
|
45
|
timestamp = models.DateTimeField(null=True, blank=True)
|
46
|
ack = models.IntegerField(null=True, blank=True)
|
47
|
ack_by_id = models.IntegerField(null=True, blank=True)
|
48
|
ack_when = models.DateTimeField(null=True, blank=True)
|
49
|
class Meta:
|
50
|
db_table = u'alarms'
|
51
|
|
52
|
class Area(models.Model):
|
53
|
id = models.IntegerField(primary_key=True)
|
54
|
code = models.CharField(max_length=150, blank=True)
|
55
|
name = models.CharField(max_length=450, blank=True)
|
56
|
class Meta:
|
57
|
db_table = u'area'
|
58
|
|
59
|
class Components(models.Model):
|
60
|
id = models.IntegerField(primary_key=True)
|
61
|
name = models.CharField(max_length=600, blank=True)
|
62
|
value = models.CharField(max_length=600, blank=True)
|
63
|
host_id = models.IntegerField(null=True, blank=True)
|
64
|
timestamp = models.DateTimeField(null=True, blank=True)
|
65
|
class Meta:
|
66
|
db_table = u'components'
|
67
|
|
68
|
class Computer(models.Model):
|
69
|
id = models.IntegerField(primary_key=True)
|
70
|
school_id = models.IntegerField()
|
71
|
hostname = models.CharField(max_length=600, blank=True)
|
72
|
serial_number = models.CharField(max_length=600, blank=True)
|
73
|
video_serial_number = models.CharField(max_length=600, blank=True)
|
74
|
location = models.CharField(max_length=600, blank=True)
|
75
|
warranty_expire = models.DateField(null=True, blank=True)
|
76
|
dismissed = models.IntegerField(null=True, blank=True)
|
77
|
class Meta:
|
78
|
db_table = u'computer'
|
79
|
|
80
|
class GroupPermission(models.Model):
|
81
|
group_id = models.IntegerField()
|
82
|
permission_id = models.IntegerField()
|
83
|
class Meta:
|
84
|
db_table = u'group_permission'
|
85
|
|
86
|
class HostScrapBook(models.Model):
|
87
|
id = models.IntegerField(primary_key=True)
|
88
|
host_id = models.IntegerField()
|
89
|
user_id = models.IntegerField(null=True, blank=True)
|
90
|
content = models.CharField(max_length=6000)
|
91
|
timestamp = models.DateTimeField(null=True, blank=True)
|
92
|
class Meta:
|
93
|
db_table = u'host_scrap_book'
|
94
|
|
95
|
class OtherHardware(models.Model):
|
96
|
id = models.IntegerField(primary_key=True)
|
97
|
school_id = models.IntegerField()
|
98
|
kind_id = models.IntegerField(null=True, blank=True)
|
99
|
vendor = models.CharField(max_length=600, blank=True)
|
100
|
model = models.CharField(max_length=600, blank=True)
|
101
|
serial_number = models.CharField(max_length=600, blank=True)
|
102
|
warranty_expire = models.DateField(null=True, blank=True)
|
103
|
location = models.CharField(max_length=600, blank=True)
|
104
|
dismissed = models.IntegerField(null=True, blank=True)
|
105
|
class Meta:
|
106
|
db_table = u'other_hardware'
|
107
|
|
108
|
class OtherHardwareKind(models.Model):
|
109
|
id = models.IntegerField(primary_key=True)
|
110
|
name = models.CharField(max_length=600, blank=True)
|
111
|
description = models.CharField(max_length=600, blank=True)
|
112
|
class Meta:
|
113
|
db_table = u'other_hardware_kind'
|
114
|
|
115
|
class Permission(models.Model):
|
116
|
id = models.IntegerField(primary_key=True)
|
117
|
permission_name = models.CharField(max_length=48, unique=True)
|
118
|
description = models.CharField(max_length=765, blank=True)
|
119
|
class Meta:
|
120
|
db_table = u'permission'
|
121
|
|
122
|
class School(models.Model):
|
123
|
id = models.IntegerField(primary_key=True)
|
124
|
name = models.CharField(max_length=600, blank=True)
|
125
|
area_id = models.IntegerField(null=True, blank=True)
|
126
|
address = models.CharField(max_length=900, blank=True)
|
127
|
phone_number = models.CharField(max_length=600, blank=True)
|
128
|
email_address = models.CharField(max_length=600, blank=True)
|
129
|
lat = models.FloatField(null=True, blank=True)
|
130
|
lon = models.FloatField(null=True, blank=True)
|
131
|
last_timestamp = models.FloatField(null=True, blank=True)
|
132
|
class Meta:
|
133
|
db_table = u'school'
|
134
|
|
135
|
class SchoolKey(models.Model):
|
136
|
id = models.IntegerField(primary_key=True)
|
137
|
school_id = models.IntegerField()
|
138
|
fingerprint = models.CharField(max_length=600, unique=True)
|
139
|
crypto_key = models.TextField(blank=True)
|
140
|
class Meta:
|
141
|
db_table = u'school_key'
|
142
|
|
143
|
class SchoolKeyUsage(models.Model):
|
144
|
id = models.IntegerField(primary_key=True)
|
145
|
school_id = models.IntegerField()
|
146
|
key_id = models.IntegerField(null=True, blank=True)
|
147
|
timestamp = models.DateTimeField(null=True, blank=True)
|
148
|
first_data_timestamp = models.FloatField(null=True, blank=True)
|
149
|
last_data_timestamp = models.FloatField(null=True, blank=True)
|
150
|
class Meta:
|
151
|
db_table = u'school_key_usage'
|
152
|
|
153
|
class SchoolProps(models.Model):
|
154
|
id = models.IntegerField(primary_key=True)
|
155
|
school_id = models.IntegerField()
|
156
|
propname = models.CharField(max_length=600)
|
157
|
propvalue = models.CharField(max_length=600)
|
158
|
class Meta:
|
159
|
db_table = u'school_props'
|
160
|
|
161
|
class SchoolTgUser(models.Model):
|
162
|
school_id = models.IntegerField()
|
163
|
tg_user_id = models.IntegerField()
|
164
|
class Meta:
|
165
|
db_table = u'school_tg_user'
|
166
|
|
167
|
class ScrapBook(models.Model):
|
168
|
id = models.IntegerField(primary_key=True)
|
169
|
school_id = models.IntegerField()
|
170
|
user_id = models.IntegerField(null=True, blank=True)
|
171
|
content = models.CharField(max_length=6000)
|
172
|
timestamp = models.DateTimeField(null=True, blank=True)
|
173
|
class Meta:
|
174
|
db_table = u'scrap_book'
|
175
|
|
176
|
class TgGroup(models.Model):
|
177
|
id = models.IntegerField(primary_key=True)
|
178
|
group_name = models.CharField(max_length=48, unique=True)
|
179
|
display_name = models.CharField(max_length=765, blank=True)
|
180
|
created = models.DateTimeField(null=True, blank=True)
|
181
|
class Meta:
|
182
|
db_table = u'tg_group'
|
183
|
|
184
|
class TgUser(models.Model):
|
185
|
id = models.IntegerField(primary_key=True)
|
186
|
user_name = models.CharField(max_length=48, unique=True)
|
187
|
email_address = models.CharField(max_length=765, unique=True)
|
188
|
display_name = models.CharField(max_length=765, blank=True)
|
189
|
password = models.CharField(max_length=120, blank=True)
|
190
|
created = models.DateTimeField(null=True, blank=True)
|
191
|
class Meta:
|
192
|
db_table = u'tg_user'
|
193
|
|
194
|
class Ticket(models.Model):
|
195
|
id = models.IntegerField(primary_key=True)
|
196
|
opened = models.DateTimeField(null=True, blank=True)
|
197
|
opened_by_id = models.IntegerField(null=True, blank=True)
|
198
|
ticket_for = models.CharField(max_length=600, blank=True)
|
199
|
object_id = models.IntegerField(null=True, blank=True)
|
200
|
description = models.CharField(max_length=6000, blank=True)
|
201
|
closed = models.DateTimeField(null=True, blank=True)
|
202
|
closed_by = models.IntegerField(null=True, blank=True)
|
203
|
class Meta:
|
204
|
db_table = u'ticket'
|
205
|
|
206
|
class TicketNote(models.Model):
|
207
|
id = models.IntegerField(primary_key=True)
|
208
|
ticket_id = models.IntegerField(null=True, blank=True)
|
209
|
user_id = models.IntegerField(null=True, blank=True)
|
210
|
timestamp = models.DateTimeField(null=True, blank=True)
|
211
|
content = models.CharField(max_length=6000, blank=True)
|
212
|
class Meta:
|
213
|
db_table = u'ticket_note'
|
214
|
|
215
|
class Used(models.Model):
|
216
|
id = models.IntegerField(primary_key=True)
|
217
|
host_id = models.IntegerField()
|
218
|
timestamp = models.DateTimeField(null=True, blank=True)
|
219
|
class Meta:
|
220
|
db_table = u'used'
|
221
|
|
222
|
class UsedNotGood(models.Model):
|
223
|
id = models.IntegerField(primary_key=True)
|
224
|
host_id = models.IntegerField()
|
225
|
timestamp = models.DateTimeField(null=True, blank=True)
|
226
|
class Meta:
|
227
|
db_table = u'used_not_good'
|
228
|
|
229
|
class UserGroup(models.Model):
|
230
|
group_id = models.IntegerField()
|
231
|
user_id = models.IntegerField()
|
232
|
class Meta:
|
233
|
db_table = u'user_group'
|
234
|
|
235
|
class Visit(models.Model):
|
236
|
id = models.IntegerField(primary_key=True)
|
237
|
visit_key = models.CharField(max_length=120, unique=True)
|
238
|
created = models.DateTimeField(null=True, blank=True)
|
239
|
expiry = models.DateTimeField(null=True, blank=True)
|
240
|
class Meta:
|
241
|
db_table = u'visit'
|
242
|
|
243
|
class VisitIdentity(models.Model):
|
244
|
id = models.IntegerField(primary_key=True)
|
245
|
visit_key = models.CharField(max_length=120, unique=True)
|
246
|
user_id = models.IntegerField(null=True, blank=True)
|
247
|
class Meta:
|
248
|
db_table = u'visit_identity'
|
249
|
|