Skip to content

Commit

Permalink
Merge pull request #3 from ECLK/dev
Browse files Browse the repository at this point in the history
django app from eclk repository
  • Loading branch information
hiranthaR authored Feb 23, 2020
2 parents 26685b7 + 6e8bd21 commit 354b6a1
Show file tree
Hide file tree
Showing 36 changed files with 901 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# location-service
# Location Service
Election related location identification and management

## Documentation
- Latest but unstable version will be always available on 'dev' branch.

## Contribution
- Always clone and make pull requests to **'dev' branch**.
- An **issue must be always created and be assigned** before making a pull request and related issues be mentioned on the pull request.
- When you cannot assign yourself on an issue, you must still mention on the issue as a comment, that you are working on it.
- To avoid time of efforts being wasted, please mention **date of delivery possible at best** as a comment on the particular issue.
- When you look for new issues to work on, do check for **projects boards on 'Projects' tab**, then the particular issues assigned to a project board, or filter issues by **'projects' column**.
- When you introduce new issues, please clarify from the owners or the management team members, before you start working on it.
161 changes: 161 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Expand Down
Empty file added backend/location/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions backend/location/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions backend/location/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class LocationConfig(AppConfig):
name = 'location'
113 changes: 113 additions & 0 deletions backend/location/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Generated by Django 3.0.3 on 2020-02-17 06:12

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Electroaldistrict',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name_sinhala', models.CharField(max_length=100)),
('name_tamil', models.CharField(max_length=100)),
('name_english', models.CharField(max_length=100)),
('ed_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Gramaniladaridivision',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name_sinhala', models.CharField(max_length=100)),
('name_tamil', models.CharField(max_length=100)),
('name_english', models.CharField(max_length=100)),
('gdn_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Locations',
fields=[
('code', models.CharField(max_length=15, primary_key=True, serialize=False)),
('name_sinhala', models.CharField(max_length=250)),
('name_tamil', models.CharField(max_length=250)),
('name_english', models.CharField(max_length=250)),
('coordinate_east', models.FloatField()),
('coordinate_north', models.FloatField()),
('location_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
('gdn_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Gramaniladaridivision')),
],
),
migrations.CreateModel(
name='Polingdivision',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name_sinhala', models.CharField(max_length=100)),
('name_tamil', models.CharField(max_length=100)),
('name_english', models.CharField(max_length=100)),
('pd_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
('electoral_district_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Electroaldistrict')),
],
),
migrations.CreateModel(
name='Media_items',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=150)),
('description', models.CharField(max_length=250)),
('file_name', models.CharField(max_length=250)),
('file_type', models.CharField(max_length=250)),
('lat', models.FloatField()),
('lon', models.FloatField()),
('status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
('loc_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Locations')),
],
),
migrations.CreateModel(
name='Location_contacts',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('contact_type', models.CharField(max_length=20)),
('contact_details', models.CharField(max_length=200)),
('lc_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
('location_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Locations')),
],
),
migrations.AddField(
model_name='gramaniladaridivision',
name='electoral_district_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Polingdivision'),
),
migrations.CreateModel(
name='Admindistrict',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name_sinhala', models.CharField(max_length=100)),
('name_tamil', models.CharField(max_length=100)),
('name_english', models.CharField(max_length=100)),
('district_status', models.BooleanField(default=True)),
('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)),
('electoral_district_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Electroaldistrict')),
],
),
]
18 changes: 18 additions & 0 deletions backend/location/migrations/0002_auto_20200217_1259.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.0.3 on 2020-02-17 07:29

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('location', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='gramaniladaridivision',
old_name='electoral_district_id',
new_name='polingdivision_id',
),
]
43 changes: 43 additions & 0 deletions backend/location/migrations/0003_auto_20200217_1303.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 3.0.3 on 2020-02-17 07:33

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('location', '0002_auto_20200217_1259'),
]

operations = [
migrations.RenameField(
model_name='admindistrict',
old_name='electoral_district_id',
new_name='electoral_district',
),
migrations.RenameField(
model_name='gramaniladaridivision',
old_name='polingdivision_id',
new_name='polingdivision',
),
migrations.RenameField(
model_name='location_contacts',
old_name='location_code',
new_name='location',
),
migrations.RenameField(
model_name='locations',
old_name='gdn_id',
new_name='gdn',
),
migrations.RenameField(
model_name='media_items',
old_name='loc_code',
new_name='location',
),
migrations.RenameField(
model_name='polingdivision',
old_name='electoral_district_id',
new_name='electoral_district',
),
]
25 changes: 25 additions & 0 deletions backend/location/migrations/0004_auto_20200217_1338.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.0.3 on 2020-02-17 08:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('location', '0003_auto_20200217_1303'),
]

operations = [
migrations.AddField(
model_name='locations',
name='latitude',
field=models.FloatField(default=1),
preserve_default=False,
),
migrations.AddField(
model_name='locations',
name='longitute',
field=models.FloatField(default=6.0),
preserve_default=False,
),
]
Loading

0 comments on commit 354b6a1

Please sign in to comment.