-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize Sources #24
Labels
Comments
Here is the model: class Source(db.Model):
"""
Stores information about data sources from the BLS API
"""
__tablename__ = "source"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Unicode(255), unique=True, index=True)
description = db.Column(db.Unicode(255), nullable=True)
series = db.relationship('Series', backref='source', lazy='dynamic')
class Series(db.Model):
"""
Stores information about TimeSeries data on the BLS API
"""
__tablename__ = "series"
id = db.Column(db.Integer, primary_key=True)
blsid = db.Column(db.Unicode(255), unique=True, index=True)
title = db.Column(db.Unicode(255), nullable=True)
source_id = db.Column(db.Integer, db.ForeignKey('source.id'))
is_primary = db.Column(db.Boolean, default=False)
records = db.relationship('SeriesRecord', backref='series',
lazy='dynamic')
def __repr__(self):
return "<Series %s>" % self.blsid |
For the migrations:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now the sources that are allowed (CPS, CESN) and disallowed (LAUS, CESSM) are hardcoded into the SourcesView object for the API.
Allowed sources are short enough to give all data to the app, disallowed sources (with state contexts) are too long to give an entire data set from.
We need to generalize the sources such that the database determines if the source is allowed or not. E.g. by creating a sources model.
Note that any source not found in the hardcoded sets is simply a 404.
The text was updated successfully, but these errors were encountered: