Skip to content
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

Bringing fork upto date #1

Merged
merged 102 commits into from
Aug 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
346547a
Update ReadMe with the FloodMap Repo Link
aswinmohanme Aug 16, 2018
f694752
Optmized RequestAdmin actions:
Aug 17, 2018
8fb1102
Updated dmoinfo view to lower DB hits per request from 5 to 3.
Aug 17, 2018
a40e1bf
Merge remote-tracking branch 'upstream/master'
Aug 17, 2018
85b4886
Merge remote-tracking branch 'upstream/master'
Aug 17, 2018
8082938
Update models.py
gautam1858 Aug 17, 2018
ea7e3d0
Update models.py
gautam1858 Aug 17, 2018
85d0f00
Implemented placepicker using Modals
irshadshalu Aug 19, 2018
ed6ac1d
Fixed map scroll issue, modal close issue, added single touch scroll,…
irshadshalu Aug 19, 2018
bf7819b
map-view icons made distinct
cyriac Aug 19, 2018
1be8741
Merge remote-tracking branch 'upstream/master'
Aug 20, 2018
82a53d6
Fixed a typo: QuerySet typed as Queryset.
Aug 20, 2018
8a9618f
Added change for elapsed time
Aug 20, 2018
c619609
Merge branch 'master' of https://github.com/IEEEKeralaSection/rescuek…
Aug 20, 2018
eb6ebfe
css: reduce font-size of title to avoid vertical scroll
Aug 21, 2018
0c4a7ee
Merge branch 'master' of https://github.com/IEEEKeralaSection/rescuek…
Aug 22, 2018
5f15379
Merge branch 'master' of https://github.com/IEEEKeralaSection/rescuek…
Aug 22, 2018
0220ff2
Merge branch 'master' of https://github.com/IEEEKeralaSection/rescuek…
Aug 28, 2018
b1b2639
കഴിഞ്ഞു പോയ സമയം updated
Aug 28, 2018
a6f4aa1
better placepicker and pop up msg
biswaz Aug 28, 2018
51838c5
Merge branch 'salmanulfarzy-irshadshalu-master'
biswaz Aug 28, 2018
f8c514c
removed help_text for request for others, to reflect new changes
biswaz Aug 28, 2018
198dfb1
added camp search on csvupload admin
biswaz Aug 28, 2018
1b55171
Added more search fields to person admin
biswaz Aug 28, 2018
7ee35bd
Merge pull request #978 from raeeska/master
biswaz Aug 29, 2018
7910b39
Fixed error on searching csvbulkupload admin
biswaz Aug 29, 2018
8dd4d0c
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Aug 29, 2018
cc9d5af
Merge branch 'master' into patch-1
biswaz Aug 29, 2018
1678a34
Merge pull request #215 from aswinmohanme/patch-1
biswaz Aug 29, 2018
57115bb
Merge pull request #448 from gautam1858/patch-2
biswaz Aug 29, 2018
6e02964
Merge pull request #853 from thelostone-mc/css
biswaz Aug 29, 2018
8da5075
Merge remote-tracking branch 'upstream/master'
Aug 29, 2018
d1a831b
Merge remote-tracking branch 'upstream/master'
Aug 29, 2018
2838178
Refactored mainapp.views.dmotal view also.
Aug 29, 2018
d417815
Added place search autocomplete field in request_form
irshadshalu Aug 30, 2018
d5615b3
Solved only cities appearing in search results
irshadshalu Aug 30, 2018
cea9914
Updated hardcoded urls to url names from urls.py
Aug 30, 2018
3477f74
Merge pull request #716 from cyriac/patch-5
vigneshhari Aug 31, 2018
3c8b3e7
In OS-X, docker do not start Postgres instance even on default port i…
pkrajanand Sep 1, 2018
16cb7c1
Merge pull request #982 from diptanshu-sopho/issue#980
biswaz Sep 1, 2018
2a3986e
Merge pull request #986 from pkrajanand/issue_985
biswaz Sep 1, 2018
ad6405d
Merge pull request #981 from irshadshalu/master
biswaz Sep 2, 2018
4e063b9
Fixed CSV Importer
vigneshhari Sep 2, 2018
fee9d3d
Merge pull request #987 from vigneshhari/master
vigneshhari Sep 2, 2018
e50b165
Altered Max Length of person
vigneshhari Sep 2, 2018
fd8e09f
Merge pull request #988 from vigneshhari/master
vigneshhari Sep 2, 2018
11d8b3d
Comment out the USE_S3 to avoid local testing errors
vigneshhari Sep 2, 2018
5f073b3
Fixed Issue with AWS in local testing
vigneshhari Sep 2, 2018
6dd05a9
Merge pull request #989 from vigneshhari/master
vigneshhari Sep 2, 2018
00e1907
Fixed Possible bug in Production
vigneshhari Sep 2, 2018
3085c93
Merge pull request #990 from vigneshhari/master
vigneshhari Sep 2, 2018
9857ad2
Removed afterflood link
biswaz Sep 2, 2018
126154a
Moved info on "docker setup" to wiki and linked from Readme
pkrajanand Sep 2, 2018
8475c09
Recovery script for reruning failed csv imports
biswaz Sep 2, 2018
6a9a226
Fixed Phone bug in CSV importer
vigneshhari Sep 2, 2018
29f3988
Merge pull request #992 from vigneshhari/master
vigneshhari Sep 2, 2018
a49833b
Checks whether district exists in csv
biswaz Sep 2, 2018
88c6ef5
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Sep 2, 2018
5df7e9f
Update README.md
biswaz Sep 2, 2018
866e7c6
Merge pull request #991 from pkrajanand/update_wiki_issue_985
vigneshhari Sep 2, 2018
124eff9
Merge pull request #788 from saba83rish/issue-785
biswaz Sep 4, 2018
e3e8d80
Update Map URL Name
vigneshhari Sep 10, 2018
d757252
Merge pull request #356 from rajeeshr-punathil/master
biswaz Sep 13, 2018
cda1ab3
Update home.html
remedcu Sep 14, 2018
8672fbd
Merge pull request #1000 from remedcu/patch-1
biswaz Sep 15, 2018
ec42644
updated django
dauntlessnomad Oct 5, 2018
59bebc7
Merge pull request #1001 from IEEEKeralaSection/syam3526-patch-1
dauntlessnomad Oct 5, 2018
84d532c
Removed datadog
Aug 8, 2019
3ad6df6
empty commit
Aug 8, 2019
2625ddc
ushahidi
Aug 8, 2019
ce8f03e
empty commit
Aug 8, 2019
7501391
Commented out toll free number
Aug 8, 2019
4e36c29
Updated mapview.html to replace old link
theshahulhameed Aug 8, 2019
9930c0b
Merge pull request #1 from shahulhameed00/shahulhameed00-patch-1
theshahulhameed Aug 8, 2019
da4ca7a
Merge pull request #1007 from shahulhameed00/master
dauntlessnomad Aug 8, 2019
a175090
Merge pull request #1006 from drtechie/dhs-number-remove
dauntlessnomad Aug 8, 2019
7fa4d60
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
Aug 9, 2019
80cb459
chnage text
biswaz Aug 9, 2019
2f68b7a
Helpline number added
rejuls Aug 9, 2019
508bd06
Hospital model, local dev dependency fix
biswaz Aug 9, 2019
9115708
Merge pull request #1008 from rejuls/patch-1
biswaz Aug 9, 2019
07bc02e
Hos[italView
biswaz Aug 9, 2019
31005a0
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Aug 9, 2019
aff1ed2
Added Card for hospitals
shameelsadaka Aug 9, 2019
2b0facb
Merge pull request #1011 from shameelsadaka/master
biswaz Aug 9, 2019
bc83b2f
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Aug 9, 2019
8f6d419
Hospitalview
biswaz Aug 9, 2019
992a4d6
Update volunteerview.html
R-Aravind Aug 9, 2019
10179d3
Update README.md
ReonSaji Aug 9, 2019
6e523c4
Added state control room number. Changes in text.
rejuls Aug 9, 2019
16d6835
Merge pull request #1015 from rejuls/patch-2
dauntlessnomad Aug 9, 2019
6bc3898
removed cm's msg
biswaz Aug 9, 2019
93dacf6
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Aug 9, 2019
3d64e0d
Merge pull request #1013 from R-Aravind/patch-1
riginoommen Aug 9, 2019
52837a9
resources form link
biswaz Aug 9, 2019
4beaa23
Urlize the links in announcements
subins2000 Aug 9, 2019
c29e830
Merge pull request #1018 from subins2000/urlize
riginoommen Aug 9, 2019
fb8be05
Hospitat search and pagination
biswaz Aug 9, 2019
ca414c1
Merge branch 'master' of github.com:IEEEKeralaSection/rescuekerala
biswaz Aug 9, 2019
906c1bc
Annoucements moved to top
biswaz Aug 9, 2019
721a770
Easified announcements priority display
subins2000 Aug 9, 2019
7aeaeba
Merge pull request #1023 from subins2000/issue1017
dauntlessnomad Aug 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: ddtrace-run gunicorn floodrelief.wsgi --timeout 600
web: gunicorn floodrelief.wsgi --timeout 600
worker: python redis_worker.py
48 changes: 13 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status - Travis][0]][1] [![Open Source Helpers](https://www.codetriage.com/ieeekeralasection/rescuekerala/badges/users.svg)](https://www.codetriage.com/ieeekeralasection/rescuekerala)

<p align="center">The Website for co-ordinating the rehabilitation of the people affected in the 2018 Kerala Floods.</p>
<p align="center">The Website for co-ordinating the rehabilitation of the people affected in the Kerala Floods.</p>

[![Join Kerala Rescue Slack channel](https://i.imgur.com/V7jxjak.png)](http://bit.ly/Keralarescuechat)

Expand Down Expand Up @@ -30,38 +30,7 @@
[^top](#table-of-contents)

#### Docker
<details>
<summary>
These instructions will get you a copy of the Docker project up and running on your local machine for development and testing purposes.
</summary>

### Using Docker

- Only pre-requisite is having docker and docker-compose installed
- Execute `sh docker.sh` in this directory (if you do not have permissions on the `docker.sh`, do `chmod +x docker.sh`)
- Server will start running at `localhost:8000`
- `Ctrl+C` to stop

#### Troubleshooting Docker
* Incompatible docker version

> ERROR: Version in "./docker-compose.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/


**Fix**

Update your docker toolkit

* Insufficient permissions
> ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


**Fix**

Run it with sudo - `sudo sh docker.sh`
</details>
- Check out this [Wiki](https://github.com/IEEEKeralaSection/rescuekerala/wiki/Using-Docker) to see how to run docker for this project.

#### [Python 3](https://www.python.org/downloads/)

Expand Down Expand Up @@ -120,9 +89,13 @@ https://github.com/vigneshhari/keralarescue_test_settings for local testing.

<details>
<summary>4. Install dependencies.</summary>

```
pip3 install -r requirements_debug.txt
```


pip3 install -r requirements.txt
pip3 install -r requirements_debug.txt

</details>

<details>
Expand Down Expand Up @@ -218,6 +191,8 @@ You can help us with verifying user submitted request from our [Ushahidi volunte
#### Contribution Guidelines
Check out this [Wiki](https://github.com/IEEEKeralaSection/rescuekerala/wiki/Contribution-Guidelines) for our contribution guidelines.

Please find issues that we need help [here](https://github.com/IEEEKeralaSection/rescuekerala/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). Go through the comments in the issue to check if someone else is already working on it. Don't forget to drop a comment when you start working on it.


<details>
<summary>Testing PRs
Expand Down Expand Up @@ -281,3 +256,6 @@ has the bug number in the branch name.
</details>

<hr>

### Flood Map
You can find the repo for the Flood Map here : https://github.com/aswinmohanme/kerala-flood-map
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
db:
image: postgres
restart: always
ports:
- 5432:5432

redis:
image: redis
Expand Down
5 changes: 2 additions & 3 deletions floodrelief/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def get_list(text):
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'ddtrace.contrib.django',
]

if DEBUG:
Expand All @@ -94,7 +93,7 @@ def get_list(text):
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']

DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.timer.TimerPanel',
'pympler.panels.MemoryPanel',
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.settings.SettingsPanel',
Expand Down Expand Up @@ -230,7 +229,7 @@ def get_list(text):
S3_URL = "https://{}.s3.ap-south-1.amazonaws.com".format(bucket_name,)


if os.environ.get('USE_S3'):
if os.environ.get('USE_S3','').lower() == "true" :
AWS_STORAGE_BUCKET_NAME=bucket_name
AWS_ACCESS_KEY_ID=os.environ.get("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY=os.environ.get("AWS_SECRET_ACCESS_KEY")
Expand Down
13 changes: 9 additions & 4 deletions mainapp/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from mainapp.redis_queue import bulk_csv_upload_queue
from mainapp.csvimporter import import_inmate_file
from .models import Request, Volunteer, Contributor, DistrictNeed, DistrictCollection, DistrictManager, vol_categories, \
RescueCamp, Person, NGO, Announcements, DataCollection , PrivateRescueCamp , CollectionCenter, CsvBulkUpload, RequestUpdate
RescueCamp, Person, NGO, Announcements, DataCollection , PrivateRescueCamp , CollectionCenter, CsvBulkUpload, RequestUpdate, \
Hospital

"""
Helper function for streaming csv downloads
Expand Down Expand Up @@ -65,14 +66,17 @@ class RequestAdmin(admin.ModelAdmin):
list_filter = ('district', 'status','dateadded')

def mark_as_completed(self, request, queryset):
self.message_user(request, "Marked selected requests as completed.")
queryset.update(status='sup')
return

def mark_as_new(self, request, queryset):
self.message_user(request, "Marked selected requests as new.")
queryset.update(status='new')
return

def mark_as_ongoing(self, request, queryset):
self.message_user(request, "Marked selected requests as ongoing.")
queryset.update(status='pro')
return

Expand Down Expand Up @@ -214,6 +218,7 @@ class PersonAdmin(admin.ModelAdmin):
list_display = ('name', 'camped_at', 'added_at', 'phone', 'age', 'gender', 'camped_at_district', 'camped_at_taluk')
ordering = ('-added_at',)
list_filter = ('camped_at__district', 'camped_at__taluk')
search_fields = ['camped_at__district', 'camped_at__name', 'name']

def camped_at_taluk(self, instance):
return instance.camped_at.taluk
Expand Down Expand Up @@ -252,7 +257,8 @@ def save_model(self, request, obj, form, change):
)
autocomplete_fields = ['camp']
readonly_fields = ['is_completed', 'failure_reason']
list_display = ['name','camp','is_completed']
list_display = ['name', 'camp', 'is_completed']
search_fields = ['camp__name']

admin.site.register(Request, RequestAdmin)
admin.site.register(Volunteer, VolunteerAdmin)
Expand All @@ -267,5 +273,4 @@ def save_model(self, request, obj, form, change):
admin.site.register(Announcements, AnnouncementAdmin)
admin.site.register(Person, PersonAdmin)
admin.site.register(DataCollection, DataCollectionAdmin)
admin.site.register(CsvBulkUpload, CsvBulkUploadAdmin)
admin.site.register(RequestUpdate, RequestUpdateAdmin)
admin.site.register(Hospital)
23 changes: 15 additions & 8 deletions mainapp/csvimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ def parsedate(str):
return datetime.datetime.strptime(str, "%d/%m/%Y" )
return None
except :
print(str)
return None

def import_inmate_file(csvid):
def import_inmate_file(csvid, is_recovery=False):

import django
django.setup()
Expand Down Expand Up @@ -51,6 +50,7 @@ def import_inmate_file(csvid):
empty = 0
header = ["name" , "phone" , "address" , "notes" , "district" , "checkin_date" , "checkout_date" , "gender" , "age" ]
for i in header:
if(datum.get(i, "") == None):empty+=1;continue
if(datum.get(i, "").strip() == ""):empty+=1
if(empty == len(header)):
continue
Expand All @@ -62,12 +62,15 @@ def import_inmate_file(csvid):
elif(datum.get("gender", "")[0] == "f" or datum.get("gender", "")[0] == "F"):
gender = 1
age = '-1'
if(datum.get("age", "").strip() != ""):
age = datum.get("age", "").strip()

if(datum.get("age", "") != None):
if(datum.get("age", "").strip() != ""):
age = datum.get("age", "").strip()
district = ""
if(datum.get("district", "") != None):
district = district.lower()

Person(
name = datum.get("name", ""),
name = datum.get("name", "")[:50],
phone = datum.get("phone", ""),
age = int(float(age)),
gender = gender,
Expand All @@ -79,8 +82,12 @@ def import_inmate_file(csvid):
checkin_date = parsedate(datum.get("checkin_date", None)),
checkout_date = parsedate(datum.get("checkout_date", None))
).save()
CsvBulkUpload.objects.filter(id = csvid).update(is_completed = True)
CsvBulkUpload.objects.filter(id = csvid).update(failure_reason = '')

if is_recovery:
csv_name = CsvBulkUpload.objects.get(id=csvid).name
CsvBulkUpload.objects.filter(id = csvid).update(is_completed = True, failure_reason = '', name="rec-"+csv_name[:15])
else:
CsvBulkUpload.objects.filter(id = csvid).update(is_completed = True, failure_reason = '')
except Exception as e:
CsvBulkUpload.objects.filter(id = csvid).update(failure_reason=(getattr(e, 'message', repr(e))))

Expand Down
15 changes: 15 additions & 0 deletions mainapp/management/recover_csv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from mainapp.models import CsvBulkUpload
from mainapp.redis_queue import bulk_csv_upload_queue
from mainapp.csvimporter import import_inmate_file

incompleted_csv_imports = CsvBulkUpload.objects.filter(is_completed=False, failure_reason__icontains="long")


for csv in incompleted_csv_imports:
bulk_csv_upload_queue.enqueue(
import_inmate_file, csv.pk, True
)


#For Shell Testing
#exec(open('mainapp/management/recover_csv.py').read())
18 changes: 18 additions & 0 deletions mainapp/migrations/0092_auto_20180828_1407.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1 on 2018-08-28 08:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mainapp', '0091_merge_20180825_1236'),
]

operations = [
migrations.AlterField(
model_name='request',
name='is_request_for_others',
field=models.BooleanField(default=False, verbose_name='Requesting for others - മറ്റൊരാൾക്ക് വേണ്ടി അപേക്ഷിക്കുന്നു '),
),
]
18 changes: 18 additions & 0 deletions mainapp/migrations/0093_auto_20180902_1802.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1 on 2018-09-02 12:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mainapp', '0092_auto_20180828_1407'),
]

operations = [
migrations.AlterField(
model_name='person',
name='name',
field=models.CharField(max_length=51, verbose_name='Name - പേര്'),
),
]
18 changes: 18 additions & 0 deletions mainapp/migrations/0094_auto_20180902_2329.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1 on 2018-09-02 17:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mainapp', '0093_auto_20180902_1802'),
]

operations = [
migrations.AlterField(
model_name='person',
name='phone',
field=models.CharField(blank=True, max_length=14, null=True, verbose_name='Mobile - മൊബൈൽ'),
),
]
26 changes: 26 additions & 0 deletions mainapp/migrations/0095_hospital.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 2.1.2 on 2019-08-09 07:07

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mainapp', '0094_auto_20180902_2329'),
]

operations = [
migrations.CreateModel(
name='Hospital',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('officer', models.CharField(max_length=100)),
('designation', models.CharField(max_length=250)),
('landline', models.CharField(max_length=14, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message='Please Enter 10/11 digit mobile number or landline as 0<std code><phone number>', regex='^((\\+91|91|0)[\\- ]{0,1})?[456789]\\d{9}$')])),
('mobile', models.CharField(max_length=14, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message='Please Enter 10/11 digit mobile number or landline as 0<std code><phone number>', regex='^((\\+91|91|0)[\\- ]{0,1})?[456789]\\d{9}$')])),
('email', models.EmailField(max_length=254)),
],
),
]
22 changes: 18 additions & 4 deletions mainapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ class Request(models.Model):
latlng_accuracy = models.CharField(max_length=100, verbose_name='GPS Accuracy - GPS കൃത്യത ', blank=True)
# If it is enabled no need to consider lat and lng
is_request_for_others = models.BooleanField(
verbose_name='Requesting for others - മറ്റൊരാൾക്ക് വേണ്ടി അപേക്ഷിക്കുന്നു ', default=False,
help_text="If this is checked, enter other's location from the \'Enter location manually\' button at the bottom")
verbose_name='Requesting for others - മറ്റൊരാൾക്ക് വേണ്ടി അപേക്ഷിക്കുന്നു ', default=False)

needwater = models.BooleanField(verbose_name='Water - വെള്ളം')
needfood = models.BooleanField(verbose_name='Food - ഭക്ഷണം')
Expand Down Expand Up @@ -174,6 +173,8 @@ def summarise(self):
out += "\nToilet Requirements :\n {}".format(self.detailtoilet)
if(self.needkit_util):
out += "\nKit Requirements :\n {}".format(self.detailkit_util)
if(self.needrescue):
out += "\nRescue Action :\n {}".format(self.detailrescue)
if(len(self.needothers.strip()) != 0):
out += "\nOther Needs :\n {}".format(self.needothers)
return out
Expand Down Expand Up @@ -450,8 +451,8 @@ def __str__(self):


class Person(models.Model):
name = models.CharField(max_length=30,blank=False,null=False,verbose_name="Name - പേര്")
phone = models.CharField(max_length=11,null=True,blank=True,verbose_name='Mobile - മൊബൈൽ')
name = models.CharField(max_length=51,blank=False,null=False,verbose_name="Name - പേര്")
phone = models.CharField(max_length=14,null=True,blank=True,verbose_name='Mobile - മൊബൈൽ')
age = models.IntegerField(null=True,blank=True,verbose_name="Age - പ്രായം")
gender = models.IntegerField(
choices = gender,
Expand Down Expand Up @@ -673,3 +674,16 @@ def full_clean(self, *args, **kwargs):

def __str__(self):
return self.name

class Hospital(models.Model):
name = models.CharField(max_length=200)
officer = models.CharField(max_length=100)
designation = models.CharField(max_length=250, verbose_name="Officer name")
phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0<std code><phone number>', code='invalid_mobile')
landline = models.CharField(max_length=14, validators=[phone_number_regex])
mobile = models.CharField(max_length=14, validators=[phone_number_regex])
email = models.EmailField()

def __str__(self):
return self.name + ' - ' + self.designation

4 changes: 2 additions & 2 deletions mainapp/templates/mainapp/camp_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

{% block content %}
<div class="text-right">
<a href="/coordinator_home">Coordinator Home</a> |
<a href="/logout">Logout</a>
<a href="{%url 'coordinator_home' %}">Coordinator Home</a> |
<a href="{%url 'user_logout' %}">Logout</a>
</div>

<h3 class="text-center">
Expand Down
4 changes: 2 additions & 2 deletions mainapp/templates/mainapp/camp_requirements.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

{% block content %}
<div class="text-right">
<a href="/coordinator_home">Coordinator Home</a> |
<a href="/logout">Logout</a>
<a href="{%url 'coordinator_home' %}">Coordinator Home</a> |
<a href="{%url 'user_logout' %}">Logout</a>
</div>

<h3 class="text-center">
Expand Down
Loading