ifrcgo / go-api Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Regions should not be editable as they are derived from countries.
Running ingest_mdb
the first time on a fresh database works great.
After it runs subsequent times, I've found that the user table gets weird. Currently there are just 7 users in the user table. When I ran it the first time, I confirmed that there were many more (I was able to search for myself through the API, and my user number is in the 13,000's).
Also I don't think the ingest logs are working, getting this working would really help debug this.
Creations and edits of relevant objects should trigger email notifications to user who have subscribed to these notifications.
This will entail creating a separate app for notifications, and a model to hold these subscription preferences.
Update README with
To start, index page titles for each data page (field report, appeal, event, etc) along with the type of page.
Create table structure so admins can modify their current ERU deployments and indicate available resources.
If possible I'd like to avoid the schema structure we used for field report sources, where there are a fixed universe of source 'types' but each new source is essentially a new record, since that makes it harder to create and modify in the admin.
Default tastypie cache is no-cache
, which we should change down the road.
Initial sync can take a bit of time and we don't want to start another sync before the first has finished.
The base Django user model only has username, first and last name, and email address. The Django user model is easily extended to include additional information (called a User Profile).
The existing database has extra user info, such as additional contact info among other things. If we need to create user profiles we need to know which fields of the original database should be carried over.
We should take care to version the API, either individual routes or the entirety of Phase 1.
@matthewhanson these are the notes from Sasi on ingesting the GDACs data:
Info from GDACS (What we refer as emergency in Go is referred as event in GDACS)
http://gdacs.org/rss.aspx?profile=ARCHIVE&fromarchive=true&from=2017-12-05&to=2017-12-06
The above rss feed provides the archive of all the disasters from a specific date to specific date. So, you can consume the latest events on a given day. Some events might be active for few weeks. Each event in GDACS has an event ID. So, a new event will be created if the event ID do not exist.
If there are changes, the events will be found in the archive link below and needs to be updated weekly once.
http://gdacs.org/Xml/rssarchive.xml
Each event is embedded in the item tag
title - Text
description - Text
image - URL (from enclosure tag)
report - URL (This is coming from the link tag)
publishedDate - DateTime
year - Int (From the gdacs:year)
lat - (from geo:Point -> geo:lat)
long - (from geo:Point -> geo:long)
eventType - (from gdacs:eventtype)
alertLevel - (from gdacs:alertlevel)
alertScore - (from gdacs:alertscore)
eventID - (from gdacs:eventid)
severity - Text ( from gdacs:severity)
severityUnit ( from gdacs:severity --->unit )
severityValue ( from gdacs:severity ----> value )
populationUnit - (from gdacs:population ---> unit )
populationValue - (from gdacs:population ----> value)
vulnerability - (from gdacs:vulnerability ----> value)
country - (from gdacs:country)
ISO3 code - (from gdacs:resource id="jsonEvent", you can find the URL for JSON and ISO3 code lies with in it. This JSON is not well maintained. Otherwise, we might have got all the above information from this)
An emergency page will be generated only when alert level for the event is Orange or Red
Newest additions to models are no longer completely covered by tests. Use code coverage module to check % coverage
Including error responses.
Also, look into turning off the default Django HTML responses for 500
status codes, etc.
ERU types referenced in IFRCGo/go-frontend#32
This is because Django's is_authenticated
scheme doesn't work for our api key authentication.
Ideally there is a proper method to call, otherwise we will just have to check the auth settings in the header against what we've stored.
@matthewhanson field reports should have an owner who is a member of the User
table, but this can and should be null for all of the automatically-ingested reports.
Need to figure out the possible choices here, but the field should definitely be an enum type field.
Ie, include contacts, etc.
Currently using vanilla coverage
.
This should speed up some larger queries with more relations.
There are actually two facets to this:
setting the BULK_IMPORT
env variable inside of ingest_appeals
doesn't actually work, it needs to be set before the script commences.
we shouldn't disable elasticsearch indexing during sync, since that's one of the primary ways that new appeals get created.
Starting with the bare minimum for authentication.
Populate existing subscriptions table from existing DMIS data
Two possible fixes:
overflow:hidden
).I think we shouldn't worry about this until next week, but making a note of it for now.
Figure out why appeals and field reports aren't appearing in search.
For example, you could subscribe the creation of a new field report, appeal, or event.
Update the Country and DisasterType models to include additional fields as given in the fixture data.
Add fixture data for Countries and DisasterTypes to django api app
We need to create an endpoint to upload documents and link them to existing objects (ie to an appeal).
@renecnielsen where do historic appeals documents and situation reports currently live?
Ordering for lots of items in the admin are off. Make them alphabetical or otherwise logically ordered.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.