-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
hiber/apps/bathouse/models.py
Outdated
watcher_first_name = models.CharField(max_length=50) | ||
watcher_last_name = models.CharField(max_length=50) | ||
email = models.EmailField(max_length=75) | ||
longitude = models.CharField(max_length=20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 7-8, we might not need to store it as just a string. I didn't realize that PostgreSQL has an extension to store point data (PostGIS, which is addressed in the Django docs). It might be easier to use a native format so that when we return this data over API, we know that there's enforcement that this should be a decimal-looking number.
Ultimately, this is your call.
…gn key for user to house model.
…. also added foreign key to house model for the user (watcher).
…. also added foreign key to house model for the user (watcher).
Older project happened to have some of the old choices. Edited some choices that were split up to reflect what was in spec. Added created / updated to House model to know when a House was created or updated.
This is a fairly cool change. We want to use longitude and latitude to keep track of a bat house. This can be stored as a float, or, ideally, using PostGIS as a Point. This allows for some further data processing (related to location) to better map out bat houses. This requires a PostGIS enabled system (changes in INSTALLED_APPS & the migrations) as well as a database adapter to be aware of such.
d482ed1
to
a031257
Compare
Wow, that sucked. For the record, CircleCI's Postgres images do install gdal-dev and gdal, but Django specifically looks for library files that GDAL uses. This leads to having to install libgdal-dev so that Django does not fail when trying to execute.
Would it be easier to use another image? Yes. But none suits the needs currently. Right now, python-gdal seemed to be the best bet (same Python version we're testing against, newest GDAL), but does not have the tools CircleCI installs in their default images. docker-geodjango installs a similar toolset to CircleCI's (as noted on StackOverflow), but uses Python 3.6. We could downgrade, but that's another can of worms to not open. It's probably easiest to include a pull request to have Python 3.7 installed and not 3.6 to docker-geodjango, but it's even easier to just install the dependencies at run time, for now. I tried:
|
With that change, this closes #20, once it's merged in. |
In order for Django to not claim there's nothing being set, we provide sane defaults for town_name and property_type
Co-authored-by: Samantha Gustafson <samantha.gustafson@uconn.edu> Co-authored-by: Mark Cabanero <me@markcabanero.com> Added models to keep track of data about Houses and information about those houses. These are based off of a series of questions asked for the environmental makeup around the bat house, as well as physical attributes of the bat house. This also uses PostGIS now to keep track of the location of a bat house. This required an updated PostgreSQL image for CircleCI.
Addresses #5.