Features:
* A connector now can be associated with 'collectivites',
and each of them can have one 'guichet'.
A 'collectivite' have a name and an openADS technical identifier
A 'guichet' allow to define hours and days for when its 'collectivite' is "open"
* Each of those entities have a view to CRUD it
* For entity ForwardFile:
- Added association with a connector, and eventually a 'collectivite'
- Added ForwardFiles 'size' field
- Added updating fields 'content_type', 'file_hash' and 'size' on save()
- Added custom validation on save()
* For entity AtrealOpenads:
- Added permissions on each endpoint
- Added 'email' field support for each type of 'demandeur'
- 'numero_dossier' is now required in the url for some endpoints (previously was a GET param)
- Added 'upload_user_files' as an endpoint (but can still be used as a method with request=None)
- The 'upload_user_files()' method now only handle forward file that have status='pending'
Fixes:
* Added "*args" and "**kwargs" arguments to some connector endpoint methods
* Added 'verbose_name' and 'ordering' on each entity META
* Added decorator '@force_encoded_string_output' to prevent utf-8 issues with python2
* Added __repr__, __str__ and __unicode__ functions to each entities
* Added database indexes for each entity
* Commented out useless JSON schema imports
* Removed unused variable assignations
Refactoring:
* Moved utilities functions to utils.py file
* Added a BaseModel to provide some default functions for Models
* Added enum/translations of hard-coded values for ForwardFile 'upload_status' field
Tests:
* Added test for each entity
* Added tests files specific to utilities, forms and views
* Total code coverage is 99% with only 10 statement missed
Features:
* class AtrealOpenads now extends HTTPResource for HTTP Basic credentials
* check_status is now also an endpoint (endpoint 'test_openads_connexion' deleted)
* added JSON schema to validate POST request input (ouput schemas are defined too but unused for now)
* added class 'LogJsonPayloadWithFileContent' to lazy log a json payload with content file filtered
* added 'attempt' field to class 'ForwardFile' that count the attempt of uploading to openADS.API
* added more controls over response data received
Refactoring:
* removed the file content in function 'get_fwd_files_status()' and added content size instead
* splitted the function 'get_fwd_files_status()' in two: one that retrieve detailed files, one only the summary
* added function 'log_json_payload()' to help to log json payloads
* added 2 functions to factorize the process of getting files from json payload
* added function 'check_file_dict()' to factorize the process of checking a file dictionary
Fixes:
* Default filename are now under 50 chars
* Make the function 'get_fwd_files_status()' consistent in its return
Tests:
* updated the test to reflect the use of HTTPResource and the split of 'get_fwd_files_status()'
More:
* Added a lot of comments
* Added endpoint anotation to validate response body, but its commented as the 'get' helper is not defined (not like the 'post' one)
Packaging:
* added author, description, classifiers, scripts and requirements in 'setup.py'
Tests:
* added support for 'tox.ini'
* moved 'tests' directory outside main python module
Fixes:
* namespace is 'atreal_openads' instead of 'passerelle.apps.atreal_openads'
* increased timeout removed from 'get' requests
* fixed timeout typo on 'self.openADS_API_timeout'