Skip to content

Commit

Permalink
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
Browse files Browse the repository at this point in the history
  • Loading branch information
biswaz committed Aug 10, 2019
2 parents 582adee + a4d2f05 commit 091fd95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mainapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@
path('consent_success/', views.ConsentSuccess.as_view(), name='consent_success'),
url(r'c/(?P<pk>\d+)/(?P<ts>\d+)/$', views.VolunteerConsent.as_view(), name='volunteer_consent'),
url('missing_and_finding_persons/', views.ReportFindPerson.as_view(), name='report_find_person'),
url('hospitals/', views.HospitalView.as_view(), name='hospitals')
url('hospitals/', views.HospitalView.as_view(), name='hospitals'),
url('announcements/api', views.announcement_api, name='announcements_api'),

]
8 changes: 8 additions & 0 deletions mainapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from collections import OrderedDict



class CustomForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(CustomForm, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -978,3 +979,10 @@ class CollectionCenterView(CreateView):
model = CollectionCenter
form_class = CollectionCenterForm
success_url = '/collection_centers/'


def announcement_api(request):
objects = Announcements.objects
data = list(objects.values())
return JsonResponse({"announcements" : data})

0 comments on commit 091fd95

Please sign in to comment.