-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add db table definition and interactions
- Loading branch information
Showing
2 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Defines the models for the ``jwql`` monitors. | ||
In Django, "a model is the single, definitive source of information | ||
about your data. It contains the essential fields and behaviors of the | ||
data you’re storing. Generally, each model maps to a single database | ||
table" (from Django documentation). Each model contains fields, such | ||
as character fields or date/time fields, that function like columns in | ||
a data table. This module defines models that are used to store data | ||
related to the JWQL monitors. | ||
Authors | ||
------- | ||
- Bryan Hilbert | ||
Use | ||
--- | ||
This module is used as such: | ||
:: | ||
from monitor_models import MyModel | ||
data = MyModel.objects.filter(name="JWQL") | ||
References | ||
---------- | ||
For more information please see: | ||
```https://docs.djangoproject.com/en/2.0/topics/db/models/``` | ||
""" | ||
# This is an auto-generated Django model module. | ||
# Feel free to rename the models, but don't rename db_table values or field names. | ||
from django.db import models | ||
|
||
|
||
class WispFinderB4QueryHistory(models.Model): | ||
entry_date = models.DateTimeField(blank=True, null=True) | ||
start_time_mjd = models.FloatField(blank=True, null=True) | ||
end_time_mjd = models.FloatField(blank=True, null=True) | ||
run_monitor = models.BooleanField(blank=True, null=True) | ||
|
||
class Meta: | ||
managed = True | ||
db_table = 'wisp_finder_b4_query_history' | ||
unique_together = (('id', 'entry_date'),) |