adrien/crimino_jail/: crimino-jail-0.2 metadata and description

Simple index

A geoloc app for jail and courts for crimino corpus website.

author Adrien Brunet - Emencia
author_email adrien@emencia.com
classifiers
  • Environment :: Web Environment
  • Framework :: Django
  • Framework :: Django :: 1.10
  • Intended Audience :: Developers
  • License :: OSI Approved :: AGPL License
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Programming Language :: Python :: 2
  • Programming Language :: Python :: 2.7
  • Topic :: Internet :: WWW/HTTP
  • Topic :: Internet :: WWW/HTTP :: Dynamic Content
license AGPL
File Tox results History
crimino_jail-0.2.tar.gz
Size
406 KB
Type
Source
Geojail
=======

Project to geolocalize jails and add metadata (images, person working in it, external urls, etc...) in a collaborative way, starting in Normandie, France. Future extension for the whole France and Europe are to be considered.

DB Schema
---------

Baseline used to create our models: geojail-merise.png
Output from django-extensions: geojail_merise_generated_posteriori.png

Install
-------

You need postgres >= 9.4 to use properly JSONField

- You need to set an environment variable called `DJANGO_MODE`, choices: 'local' or 'production'

- Add url(r'^', include('crimino_jail.urls')) in your urls.py

- In your `INSTALLED_APPS`, add `'crimino_jail'` and `'modeltranslation'`.
`modeltranslation` should be placed on top of the installed apps.
There is an automatic check which makes sure both of these apps are in INSTALLED_APPS.

- You obviously need a superuser to access the admin and populate the db


ORDER ADMIN APPS (unused for now)
---------------------------------

If we *absolutely* need a custom order for models in admin lists, it has been implemented within this project (while discouraged).

The alphabetical order (default) is good enough and I don't really like the burden of maintaining a custom order hack...
This should be removed if we can convince the client it's not worth it. This could have side effects on other apps (using `admin_site.html`). Well, you get it, I don't like it. Do not use unless you're explicitely told to do so.

To have it working, follow these steps:
- ensure `'crimino_jail'` is in `INSTALLED_APPS` before `django.contrib.admin`.
`admin_site.html` has been overriden. A templatetag has been created to display the custom order.
- Set the ordering in your `settings.py` like this:

```
ADMIN_REORDER = (
('app1', ('AppModel1', 'AppModel2', )),
('app2', ('AppModel3', 'AppModel4', 'AppModel5', )),
)
```
Suggested order:

```
ADMIN_REORDER = (
(
'crimino_jail', (
'Institution',
'Image',
'Location',
'Role',
'JurisdictionArea',
'Event',
'Job',
'Person',
'Statistic',
'Video',
),
),
)
```


TEST & DEV
----------

There is requirements-dev.txt with ddb, django-extensions and pygraphviz.

Run tests with the following command:
`pytest`

To create a new db while running tests: `pytest --create-db`
The default behavior reuse the same db for performance reasons


GOOGLE MAP
----------

/!\ For production use, we need to add an API key for google map api.


RELEASE NOTES
-------------

v0.2
- Institution list view now has 2 search forms, one free and one with specific filters. Map have some regions displayed, some js magic is added.
- near me button on institution list view (for google map)
- Some fields has been added on institution (status)
- custom ordering for admin page has been added but is discouragered. Won't change anything unless specified during the install
- Previous JSONFields with MultipleCheckboxSelect widget has been rearrange with a ManyToManyField to allow end users to complete the list of choices. It has implications on the has_prisoner method, admin forms, filters, admin, and field rendering. A data migration has been added to create basic InstitutionType and PrisonerType

v0.1
- Basic detail view for institution, people and events.
- An institution list view with a map
- Django admin as a backoffice for models management.

Render warnings:
<string>:22: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.