Skip to content

Commit

Permalink
Update models and automated tasks for collecting data
Browse files Browse the repository at this point in the history
  • Loading branch information
rowvigor committed Dec 15, 2018
1 parent ae4c9c6 commit b551e69
Show file tree
Hide file tree
Showing 9 changed files with 393 additions and 144 deletions.
Empty file added fixtures
Empty file.
21 changes: 17 additions & 4 deletions news/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ def wrapper(klass):
@admin.register(models.location)
class LocationAdmin(admin.ModelAdmin):
list_display = ('city','state','keywords')
exclude = ('position',)

class URLInline(admin.TabularInline):
model = models.url
exclude = ()

@admin.register(models.tweet)
class TweetAdmin(admin.ModelAdmin):
list_displat = ('text','status','source','location','ignore')
list_filter = ('ignore',)
@admin.register(models.advisory_feed)
class AdvisoryFeedAdmin(admin.ModelAdmin):
list_display = ('source','feed',)

@admin.register(models.advisory_keyword)
class AdvisoryKeywordAdmin(admin.ModelAdmin):
list_display = ('source','keyword',)

@admin.register(models.alert)
class AlertAdmin(admin.ModelAdmin):
list_display = ('sourceId','text','status','source','location','ignore')
list_filter = ('ignore','source')
inlines = [
URLInline,
]

@admin.register(models.utility)
class UtilityAdmin(admin.ModelAdmin):
list_display = ('name','has_contaminats','violation')
7 changes: 7 additions & 0 deletions news/choice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

SOURCE = (
('goog','Google News Feed'),
('twitter','Twitter'),
('',''),
)


WATER_STATUS = (
('info','Informational'),
('boil','Boil Water'),
Expand Down
10 changes: 10 additions & 0 deletions news/fixtures/advisory_feeds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"model": "news.advisory_feed",
"pk": 1,
"fields": {
"source": "goog",
"feed": "https://www.google.com/alerts/feeds/08966076892725477175/13883181635165243708"
}
}
]
18 changes: 18 additions & 0 deletions news/fixtures/advisory_keywords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"model": "news.advisory_keyword",
"pk": 2,
"fields": {
"source": "twitter",
"keyword": "water advisory"
}
},
{
"model": "news.advisory_keyword",
"pk": 3,
"fields": {
"source": "twitter",
"keyword": "drink advisory"
}
}
]
Loading

0 comments on commit b551e69

Please sign in to comment.