Blame view

src/pyrosapp/models.py 20.7 KB
509509a8   haribo   Replacing admin.p...
1
2
3
4
5
6
7
8
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey has `on_delete` set to the desired behavior.
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from __future__ import unicode_literals
c0c999f3   Etienne Pallier   admin : view or e...
9

fde1bc96   haribo   Link User (now Py...
10
from django.contrib.auth.models import User
509509a8   haribo   Replacing admin.p...
11
from django.db import models
c0c999f3   Etienne Pallier   admin : view or e...
12
13


509509a8   haribo   Replacing admin.p...
14
15
16
17
18
class Album(models.Model):
    sequence = models.ForeignKey('Sequence', models.CASCADE, related_name="albums")
    detector = models.ForeignKey('Detector', models.DO_NOTHING, related_name="albums")
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
19
20
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
c0c999f3   Etienne Pallier   admin : view or e...
21

509509a8   haribo   Replacing admin.p...
22
23
24
    class Meta:
        managed = True
        db_table = 'album'
c0c999f3   Etienne Pallier   admin : view or e...
25

509509a8   haribo   Replacing admin.p...
26
27
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
28
29


509509a8   haribo   Replacing admin.p...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Alert(models.Model):
    request = models.OneToOneField('Request', models.CASCADE)
    strategyobs = models.ForeignKey('StrategyObs', models.DO_NOTHING, related_name="alerts")
    voevent_xml = models.TextField(blank=True, null=True)
    type = models.CharField(max_length=45, blank=True, null=True)
    client = models.CharField(max_length=45, blank=True, null=True)
    burst_jd = models.CharField(max_length=45, blank=True, null=True)
    burst_ra = models.CharField(max_length=45, blank=True, null=True)
    burst_dec = models.CharField(max_length=45, blank=True, null=True)
    equinox = models.CharField(max_length=45, blank=True, null=True)
    jd_pkt = models.IntegerField(blank=True, null=True)
    jd_send = models.IntegerField(blank=True, null=True)
    jd_received = models.IntegerField(blank=True, null=True)
    trigger_instrum = models.CharField(max_length=45, blank=True, null=True)
    trigger_num = models.CharField(max_length=45, blank=True, null=True)
    grb_error = models.CharField(max_length=45, blank=True, null=True)
3cc75c0f   haribo   other tests
46
    def_not_grb = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
47
48
49
    editor = models.CharField(max_length=45, blank=True, null=True)
    flag = models.CharField(max_length=45, blank=True, null=True)
    idgcn_notice = models.IntegerField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
50

509509a8   haribo   Replacing admin.p...
51
52
53
    class Meta:
        managed = True
        db_table = 'alert'
c0c999f3   Etienne Pallier   admin : view or e...
54

509509a8   haribo   Replacing admin.p...
55
    def __str__(self):
6d86da1b   haribo   fix #3400, #3401,...
56
57
58
59
60
        return str(self.request.name)
    
    def request_name(self):
        return self.__str__()
    request_name.short_description = "Name"
c0c999f3   Etienne Pallier   admin : view or e...
61

509509a8   haribo   Replacing admin.p...
62
63
64
65
class Country(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    quota = models.FloatField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
66

509509a8   haribo   Replacing admin.p...
67
68
69
    class Meta:
        managed = True
        db_table = 'country'
6d86da1b   haribo   fix #3400, #3401,...
70
        verbose_name_plural = "Countries"
c0c999f3   Etienne Pallier   admin : view or e...
71

509509a8   haribo   Replacing admin.p...
72
73
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
74
75


509509a8   haribo   Replacing admin.p...
76
77
78
79
80
81
82
83
class Detector(models.Model):
    device = models.OneToOneField('Device', models.CASCADE)
    telescope = models.ForeignKey('Telescope', models.DO_NOTHING, related_name="detectors")
    status = models.CharField(max_length=7, blank=True, null=True)
    nb_photo_x = models.IntegerField(blank=True, null=True)
    nb_photo_y = models.IntegerField(blank=True, null=True)
    photo_size_x = models.IntegerField(blank=True, null=True)
    photo_size_y = models.IntegerField(blank=True, null=True)
3cc75c0f   haribo   other tests
84
    has_shutter = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
85
86
87
88
89
90
91
92
    equivalent_foc_len = models.CharField(max_length=45, blank=True, null=True)
    acq_start = models.DateTimeField(blank=True, null=True)
    acq_stop = models.DateTimeField(blank=True, null=True)
    check_temp = models.FloatField(blank=True, null=True)
    gain = models.FloatField(blank=True, null=True)
    readout_noise = models.FloatField(blank=True, null=True)
    readout_time = models.FloatField(blank=True, null=True)
    idcam_readout_mode = models.IntegerField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
93

509509a8   haribo   Replacing admin.p...
94
95
96
    class Meta:
        managed = True
        db_table = 'detector'
c0c999f3   Etienne Pallier   admin : view or e...
97

509509a8   haribo   Replacing admin.p...
98
    def __str__(self):
6d86da1b   haribo   fix #3400, #3401,...
99
100
101
102
103
        return str(self.device.name)

    def device_name(self):
        return self.__str__()
    device_name.short_description = "Name"
c0c999f3   Etienne Pallier   admin : view or e...
104

509509a8   haribo   Replacing admin.p...
105
106
107
class Device(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
108
109
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
3cc75c0f   haribo   other tests
110
    is_online = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
111
112
    status = models.CharField(max_length=11, blank=True, null=True)
    maintenance_date = models.DateTimeField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
113

509509a8   haribo   Replacing admin.p...
114
115
116
    class Meta:
        managed = True
        db_table = 'device'
c0c999f3   Etienne Pallier   admin : view or e...
117

509509a8   haribo   Replacing admin.p...
118
119
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
120

509509a8   haribo   Replacing admin.p...
121
122
123
124
125
class Filter(models.Model):
    device = models.OneToOneField(Device, models.CASCADE)
    detector = models.ForeignKey(Detector, models.DO_NOTHING, related_name="filters")
    category = models.CharField(max_length=1, blank=True, null=True)
    transmission_curve_doc = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
126

509509a8   haribo   Replacing admin.p...
127
128
129
    class Meta:
        managed = True
        db_table = 'filter'
c0c999f3   Etienne Pallier   admin : view or e...
130

509509a8   haribo   Replacing admin.p...
131
    def __str__(self):
6d86da1b   haribo   fix #3400, #3401,...
132
        return (str(self.device.name))
c0c999f3   Etienne Pallier   admin : view or e...
133

6d86da1b   haribo   fix #3400, #3401,...
134
135
136
    def device_name(self):
        return self.__str__()
    device_name.short_description = "Name"
c0c999f3   Etienne Pallier   admin : view or e...
137

509509a8   haribo   Replacing admin.p...
138
139
140
141
142
class Image(models.Model):
    plan = models.ForeignKey('Plan', models.CASCADE, related_name="images")
    nrtanalysis = models.ForeignKey('NrtAnalysis', models.DO_NOTHING, blank=True, null=True, related_name="images")
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
143
144
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
509509a8   haribo   Replacing admin.p...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
    date_from_gps = models.CharField(max_length=45, blank=True, null=True)
    level = models.IntegerField(blank=True, null=True)
    type = models.CharField(max_length=5, blank=True, null=True)
    quality = models.CharField(max_length=45, blank=True, null=True)
    flaggps = models.CharField(max_length=45, blank=True, null=True)
    exposure = models.CharField(max_length=45, blank=True, null=True)
    tempext = models.CharField(max_length=45, blank=True, null=True)
    pressure = models.CharField(max_length=45, blank=True, null=True)
    humidext = models.CharField(max_length=45, blank=True, null=True)
    wind = models.CharField(max_length=45, blank=True, null=True)
    wind_dir = models.CharField(max_length=45, blank=True, null=True)
    dwnimg = models.CharField(max_length=45, blank=True, null=True)
    dwncata = models.CharField(max_length=45, blank=True, null=True)
    dwn = models.CharField(max_length=45, blank=True, null=True)
    level0_fits_name = models.CharField(max_length=45, blank=True, null=True)
    level1a_fits_name = models.CharField(max_length=45, blank=True, null=True)
    level1b_fits_name = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
162

509509a8   haribo   Replacing admin.p...
163
164
165
    class Meta:
        managed = True
        db_table = 'image'
c0c999f3   Etienne Pallier   admin : view or e...
166

509509a8   haribo   Replacing admin.p...
167
168
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
169

509509a8   haribo   Replacing admin.p...
170
171
172
class NrtAnalysis(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
173
174
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
509509a8   haribo   Replacing admin.p...
175
    analysis = models.TextField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
176

509509a8   haribo   Replacing admin.p...
177
178
179
    class Meta:
        managed = True
        db_table = 'nrtanalysis'
6d86da1b   haribo   fix #3400, #3401,...
180
        verbose_name_plural = "Nrt analyzes"
c0c999f3   Etienne Pallier   admin : view or e...
181

509509a8   haribo   Replacing admin.p...
182
183
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
184
185


509509a8   haribo   Replacing admin.p...
186
187
188
189
190
class Plan(models.Model):
    album = models.ForeignKey(Album, models.CASCADE, related_name="plans")
    filter = models.ForeignKey(Filter, models.DO_NOTHING, related_name="plans")
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.CharField(max_length=45, blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
191
192
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
509509a8   haribo   Replacing admin.p...
193
194
195
196
    duration = models.FloatField(blank=True, null=True)
    position = models.CharField(max_length=45, blank=True, null=True)
    exposure_time = models.FloatField(blank=True, null=True)
    nb_images = models.IntegerField(blank=True, null=True)
3cc75c0f   haribo   other tests
197
    dithering = models.BooleanField(default=False)
c0c999f3   Etienne Pallier   admin : view or e...
198

509509a8   haribo   Replacing admin.p...
199
200
201
    class Meta:
        managed = True
        db_table = 'plan'
c0c999f3   Etienne Pallier   admin : view or e...
202

509509a8   haribo   Replacing admin.p...
203
204
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
205
206


6d86da1b   haribo   fix #3400, #3401,...
207
208
209
210
211
class PyrosUser(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    country = models.ForeignKey(Country, models.DO_NOTHING, related_name="pyros_users")
    userlevel = models.ForeignKey('UserLevel', models.DO_NOTHING, related_name="pyros_users")
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
    url = models.CharField(max_length=45, blank=True, null=True)
    tel1 = models.CharField(max_length=45, blank=True, null=True)
    tel2 = models.CharField(max_length=45, blank=True, null=True)
    address = models.CharField(max_length=45, blank=True, null=True)
    last_connect = models.DateTimeField(blank=True, null=True)
    cur_connect = models.DateTimeField(blank=True, null=True)
    putvalid_beg = models.DateTimeField(blank=True, null=True)
    putvalid_end = models.DateTimeField(blank=True, null=True)
    acqvalid_beg = models.CharField(max_length=45, blank=True, null=True)
    acqvalid_end = models.CharField(max_length=45, blank=True, null=True)
    quota = models.FloatField(blank=True, null=True)
    quota_rea = models.FloatField(blank=True, null=True)
    u_priority = models.IntegerField(blank=True, null=True)
    p_priority = models.IntegerField(blank=True, null=True)
    dir_level = models.IntegerField(blank=True, null=True)
3cc75c0f   haribo   other tests
229
    can_del_void_req = models.BooleanField(default=False)
6d86da1b   haribo   fix #3400, #3401,...
230
231
232
233
234
235
236
237
238
239
240
241
242

    class Meta:
        managed = True
        db_table = 'pyros_user'

    def __str__(self):
        return (str(self.user.get_username()))

    def user_username(self):
        return self.__str__()
    user_username.short_description = "Username"


509509a8   haribo   Replacing admin.p...
243
class Request(models.Model):
fde1bc96   haribo   Link User (now Py...
244
    pyros_user = models.ForeignKey('PyrosUser', models.DO_NOTHING, related_name="requests")
509509a8   haribo   Replacing admin.p...
245
246
247
    scientificprogram = models.ForeignKey('ScientificProgram', models.DO_NOTHING, related_name="requests")
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
248
249
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
c0c999f3   Etienne Pallier   admin : view or e...
250
    #is_alert = models.IntegerField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
251
    is_alert = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
252
253
254
255
    type = models.CharField(max_length=8, blank=True, null=True)
    status = models.CharField(max_length=10, blank=True, null=True)
    target_or_theme = models.CharField(max_length=45, blank=True, null=True)
    priority = models.IntegerField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
256
    autodeposit = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
257
258
    checkpoint = models.CharField(max_length=45, blank=True, null=True)
    flag = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
259

509509a8   haribo   Replacing admin.p...
260
261
262
    class Meta:
        managed = True
        db_table = 'request'
c0c999f3   Etienne Pallier   admin : view or e...
263

509509a8   haribo   Replacing admin.p...
264
265
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
266
267


509509a8   haribo   Replacing admin.p...
268
class Schedule(models.Model):
6d86da1b   haribo   fix #3400, #3401,...
269
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
06241f05   haribo   Class scheduler f...
270
271
    plan_start = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
    plan_end = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
509509a8   haribo   Replacing admin.p...
272
    flag = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
273

509509a8   haribo   Replacing admin.p...
274
275
276
    class Meta:
        managed = True
        db_table = 'schedule'
c0c999f3   Etienne Pallier   admin : view or e...
277

509509a8   haribo   Replacing admin.p...
278
279
    def __str__(self):
        return (str(self.created))
c0c999f3   Etienne Pallier   admin : view or e...
280
281


509509a8   haribo   Replacing admin.p...
282
class ScheduleHistory(models.Model):
bc76e5cc   Etienne Pallier   modifs
283
    sequences = models.ManyToManyField('Sequence', related_name='schedulehistories')
6d86da1b   haribo   fix #3400, #3401,...
284
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
06241f05   haribo   Class scheduler f...
285
286
    plan_start = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
    plan_end = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
509509a8   haribo   Replacing admin.p...
287
    flag = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
288

509509a8   haribo   Replacing admin.p...
289
290
291
    class Meta:
        managed = True
        db_table = 'schedulehistory'
6d86da1b   haribo   fix #3400, #3401,...
292
        verbose_name_plural = "Schedule histories"
c0c999f3   Etienne Pallier   admin : view or e...
293

509509a8   haribo   Replacing admin.p...
294
295
    def __str__(self):
        return (str(self.created))
c0c999f3   Etienne Pallier   admin : view or e...
296
297


509509a8   haribo   Replacing admin.p...
298
class ScientificProgram(models.Model):
c0c999f3   Etienne Pallier   admin : view or e...
299
    pyros_users = models.ManyToManyField('PyrosUser', related_name="scientificprograms")
509509a8   haribo   Replacing admin.p...
300
301
302
303
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    quota = models.FloatField(blank=True, null=True)
    priority = models.IntegerField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
304

509509a8   haribo   Replacing admin.p...
305
306
307
    class Meta:
        managed = True
        db_table = 'scientificprogram'
c0c999f3   Etienne Pallier   admin : view or e...
308

509509a8   haribo   Replacing admin.p...
309
310
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
311

509509a8   haribo   Replacing admin.p...
312
class Sequence(models.Model):
06241f05   haribo   Class scheduler f...
313
314
315
316
317
318
319
320
321
    
    """ Definition of Status enum values """
    
    TOBEPLANNED = "TBP"
    OBSERVABLE = "OBS"
    UNPLANNABLE = "UNPLN"
    PLANNED = "PLND"
    EXECUTED = "EXD"
    REJECTED = "RJTD"
b87b6d9b   haribo   Finished tests fo...
322
    INVALID = "INVL"
06241f05   haribo   Class scheduler f...
323
324
325
326
327
328
    STATUS_CHOICES = (
        (TOBEPLANNED, "To be planned"),
        (OBSERVABLE, "Observable"),
        (UNPLANNABLE, "Unplannable"),
        (PLANNED, "Planned"),
        (EXECUTED, "Executed"),
b87b6d9b   haribo   Finished tests fo...
329
330
        (REJECTED, "Rejected"),
        (INVALID, "Invalid"),
06241f05   haribo   Class scheduler f...
331
332
    )
    
509509a8   haribo   Replacing admin.p...
333
334
335
336
337
    request = models.ForeignKey(Request, models.CASCADE, related_name="sequences")
    sequencetype = models.ForeignKey('SequenceType', models.DO_NOTHING, related_name="sequences")
    schedule = models.ForeignKey(Schedule, models.DO_NOTHING, related_name="sequences")
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
6d86da1b   haribo   fix #3400, #3401,...
338
339
    created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
3cc75c0f   haribo   other tests
340
    is_alert = models.BooleanField(default=False)
06241f05   haribo   Class scheduler f...
341
    status = models.CharField(max_length=11, blank=True, null=True, choices=STATUS_CHOICES)
509509a8   haribo   Replacing admin.p...
342
    pointing = models.CharField(max_length=45, blank=True, null=True)
3cc75c0f   haribo   other tests
343
    with_drift = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
344
345
    priority = models.IntegerField(blank=True, null=True)
    analysis_method = models.CharField(max_length=45, blank=True, null=True)
509509a8   haribo   Replacing admin.p...
346
347
348
349
350
    moon_min = models.IntegerField(blank=True, null=True)
    alt_min = models.IntegerField(blank=True, null=True)
    type = models.CharField(max_length=6, blank=True, null=True)
    img_current = models.CharField(max_length=45, blank=True, null=True)
    img_total = models.CharField(max_length=45, blank=True, null=True)
3cc75c0f   haribo   other tests
351
    not_obs = models.BooleanField(default=False)
6d86da1b   haribo   fix #3400, #3401,...
352
353
    obsolete = models.BooleanField(default=False)
    processing = models.BooleanField(default=False)
509509a8   haribo   Replacing admin.p...
354
    flag = models.CharField(max_length=45, blank=True, null=True)
06241f05   haribo   Class scheduler f...
355
356
357
358
359
360
361
362
    tsp = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
    tep = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
    jd1 = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
    jd2 = models.DecimalField(default=0.0, max_digits=15, decimal_places=8)
    deltaTL = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
    deltaTR = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
    t_prefered = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
    duration = models.DecimalField(default=-1.0, max_digits=15, decimal_places=8)
a046fe99   haribo   Message at the en...
363
364
    overhead = models.DecimalField(default=0, max_digits=15, decimal_places=8)
    
c0c999f3   Etienne Pallier   admin : view or e...
365

3cc75c0f   haribo   other tests
366

509509a8   haribo   Replacing admin.p...
367
368
369
    class Meta:
        managed = True
        db_table = 'sequence'
c0c999f3   Etienne Pallier   admin : view or e...
370

509509a8   haribo   Replacing admin.p...
371
372
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
373
374


509509a8   haribo   Replacing admin.p...
375
376
377
378
class SequenceType(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    priority = models.IntegerField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
379

509509a8   haribo   Replacing admin.p...
380
381
382
    class Meta:
        managed = True
        db_table = 'sequencetype'
c0c999f3   Etienne Pallier   admin : view or e...
383

509509a8   haribo   Replacing admin.p...
384
385
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
386
387


509509a8   haribo   Replacing admin.p...
388
class SiteWatch(models.Model):
6d86da1b   haribo   fix #3400, #3401,...
389
    updated = models.DateTimeField(blank=True, null=True, auto_now=True)
509509a8   haribo   Replacing admin.p...
390
391
392
393
    lights = models.CharField(max_length=45, blank=True, null=True)
    dome = models.CharField(max_length=45, blank=True, null=True)
    doors = models.CharField(max_length=45, blank=True, null=True)
    temperature = models.FloatField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
394

509509a8   haribo   Replacing admin.p...
395
396
397
    class Meta:
        managed = True
        db_table = 'sitewatch'
6d86da1b   haribo   fix #3400, #3401,...
398
        verbose_name_plural = "Site watches"
c0c999f3   Etienne Pallier   admin : view or e...
399

509509a8   haribo   Replacing admin.p...
400
401
    def __str__(self):
        return (str(self.updated))
c0c999f3   Etienne Pallier   admin : view or e...
402
403


509509a8   haribo   Replacing admin.p...
404
405
class SiteWatchHistory(models.Model):
    id = models.IntegerField(primary_key=True)
c0c999f3   Etienne Pallier   admin : view or e...
406

509509a8   haribo   Replacing admin.p...
407
408
409
    class Meta:
        managed = True
        db_table = 'sitewatchhistory'
6d86da1b   haribo   fix #3400, #3401,...
410
        verbose_name_plural = "Site watch histories"
c0c999f3   Etienne Pallier   admin : view or e...
411
412


509509a8   haribo   Replacing admin.p...
413
414
415
416
class StrategyObs(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    json_file = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
417

509509a8   haribo   Replacing admin.p...
418
419
420
    class Meta:
        managed = True
        db_table = 'strategyobs'
6d86da1b   haribo   fix #3400, #3401,...
421
        verbose_name_plural = "Strategy obs"
c0c999f3   Etienne Pallier   admin : view or e...
422

509509a8   haribo   Replacing admin.p...
423
424
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
425
426


509509a8   haribo   Replacing admin.p...
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
class Telescope(models.Model):
    device = models.OneToOneField(Device, models.CASCADE)
    mount_type = models.CharField(max_length=9, blank=True, null=True)
    diameter = models.FloatField(blank=True, null=True)
    status = models.CharField(max_length=45, blank=True, null=True)
    latitude = models.FloatField(blank=True, null=True)
    longitude = models.FloatField(blank=True, null=True)
    sens = models.CharField(max_length=1, blank=True, null=True)
    altitude = models.FloatField(blank=True, null=True)
    readout_time = models.IntegerField(blank=True, null=True)
    slew_time = models.IntegerField(blank=True, null=True)
    slew_dead = models.IntegerField(blank=True, null=True)
    slew_rate_max = models.FloatField(blank=True, null=True)
    horizon_type = models.CharField(max_length=45, blank=True, null=True)
    horizon_def = models.FloatField(blank=True, null=True)
    lim_dec_max = models.FloatField(blank=True, null=True)
    lim_dec_min = models.FloatField(blank=True, null=True)
    lim_ha_rise = models.FloatField(blank=True, null=True)
    lim_ha_set = models.FloatField(blank=True, null=True)
    address = models.CharField(max_length=45, blank=True, null=True)
    night_elev_sun = models.FloatField(blank=True, null=True)
    mpc_code = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
449

509509a8   haribo   Replacing admin.p...
450
451
452
    class Meta:
        managed = True
        db_table = 'telescope'
c0c999f3   Etienne Pallier   admin : view or e...
453

509509a8   haribo   Replacing admin.p...
454
455
    def __str__(self):
        return (self.device.name)
c0c999f3   Etienne Pallier   admin : view or e...
456
457


509509a8   haribo   Replacing admin.p...
458
459
460
461
462
class UserLevel(models.Model):
    name = models.CharField(max_length=45, blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    priority = models.IntegerField(blank=True, null=True)
    quota = models.FloatField(blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
463

509509a8   haribo   Replacing admin.p...
464
465
466
    class Meta:
        managed = True
        db_table = 'userlevel'
c0c999f3   Etienne Pallier   admin : view or e...
467

509509a8   haribo   Replacing admin.p...
468
469
    def __str__(self):
        return (str(self.name))
c0c999f3   Etienne Pallier   admin : view or e...
470
471


509509a8   haribo   Replacing admin.p...
472
473
474
475
476
477
478
479
480
481
482
class WeatherWatch(models.Model):
    updated = models.DateTimeField(blank=True, null=True)
    humid_int = models.FloatField(blank=True, null=True)
    humid_ext = models.FloatField(blank=True, null=True)
    wind = models.FloatField(blank=True, null=True)
    wind_dir = models.CharField(max_length=1, blank=True, null=True)
    temp_int = models.FloatField(blank=True, null=True)
    temp_ext = models.FloatField(blank=True, null=True)
    pressure = models.FloatField(blank=True, null=True)
    rain = models.FloatField(blank=True, null=True)
    dwn = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
483

509509a8   haribo   Replacing admin.p...
484
485
486
    class Meta:
        managed = True
        db_table = 'weatherwatch'
6d86da1b   haribo   fix #3400, #3401,...
487
        verbose_name_plural = "Weather watches"
c0c999f3   Etienne Pallier   admin : view or e...
488

509509a8   haribo   Replacing admin.p...
489
490
    def __str__(self):
        return (str(self.updated))
c0c999f3   Etienne Pallier   admin : view or e...
491
492


509509a8   haribo   Replacing admin.p...
493
class WeatherWatchHistory(models.Model):
6d86da1b   haribo   fix #3400, #3401,...
494
    datetime = models.DateTimeField(blank=True, null=True, auto_now_add=True)
509509a8   haribo   Replacing admin.p...
495
496
497
498
499
500
501
502
503
    humid_int = models.CharField(max_length=45, blank=True, null=True)
    humid_ext = models.CharField(max_length=45, blank=True, null=True)
    wind = models.CharField(max_length=45, blank=True, null=True)
    wind_dir = models.CharField(max_length=45, blank=True, null=True)
    temp_int = models.CharField(max_length=45, blank=True, null=True)
    temp_ext = models.CharField(max_length=45, blank=True, null=True)
    pressure = models.CharField(max_length=45, blank=True, null=True)
    rain = models.CharField(max_length=45, blank=True, null=True)
    dwn = models.CharField(max_length=45, blank=True, null=True)
c0c999f3   Etienne Pallier   admin : view or e...
504

509509a8   haribo   Replacing admin.p...
505
506
507
    class Meta:
        managed = True
        db_table = 'weatherwatchhistory'
6d86da1b   haribo   fix #3400, #3401,...
508
        verbose_name_plural = "Weather watch histories"
c0c999f3   Etienne Pallier   admin : view or e...
509

509509a8   haribo   Replacing admin.p...
510
511
    def __str__(self):
        return (str(self.datetime))