- Nov 17, 2017
-
-
Benjamin Bertrand authored
-
- Nov 15, 2017
-
-
Benjamin Bertrand authored
Don't ovveride SQLAlchemy __init__ method on db.Model classes. See http://flask-sqlalchemy.pocoo.org/2.3/quickstart/: SQLAlchemy adds an implicit constructor to all model classes which accepts keyword arguments for all its columns and relationships. If you decide to override the constructor for any reason, make sure to keep accepting **kwargs and call the super constructor with those **kwargs to preserve this behavior
-
Benjamin Bertrand authored
-
- Nov 14, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
ValidationError is catched by default by flask-admin. It's easy to catch in the api/main.py to raise a CSEntryError. We actually don't need to catch ValidationError as it's based on ValueError that we already catch.
-
Benjamin Bertrand authored
Use full exception error as message (error messages from psycopg2 can be quite long but that makes it much more explicit)
-
Benjamin Bertrand authored
TODO: we should maybe raise ValidationError in models and catch that to raise CSEntryError in the API
-
Benjamin Bertrand authored
Note that beginning with version 10, a major release is indicated by increasing the first part of the version, e.g. 10 to 11. So 10.1 will be a minor version. That's why we can use the docker tag "10". See https://www.postgresql.org/support/versioning/
-
Benjamin Bertrand authored
The database constraints will catch the same error (and raise an IntegrityError). Having some validation at the model level allows to display nicer error messages. We use CSEntryError exception and not ValidationError so that it can be used both by the API and views.
-
Benjamin Bertrand authored
Allow to use the same CSEntryError exceptions used for validation in the API and admin views.
-
Benjamin Bertrand authored
Trying to insert an invalid IP or network address raises an exception. This is due to the unique validator from flask-admin that queries the database. The unique validator is automatically added for columns with unique=True. The only way to disable it is to monkey patch the Unique class. This allows the field validator to catch invalid format. IntegrityError are already catched anyway.
-
Benjamin Bertrand authored
- replace TextAreaField by StringField for several Text columns - add filter to replace empty string by None on optional Text and INET fields
-
- Nov 13, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
Don't override the Admin view __init__ method for consistency. Avoid having to import models in admin/views.py
-
Benjamin Bertrand authored
CIText is displayed as a TextAreaField by flask-admin. Override it to use StringField.
-
Benjamin Bertrand authored
- Allow to pass several mandatory fields in create_generic_model - Add tests
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
- A network defines an available range of IP addresses - A host defines an IP address and name - A host is always linked to a network - A mac address is always linked to an item (physical equipment) - A mac address can be linked to one host (IP) - An item can have several mac addresses
-
- Nov 10, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
Text is as efficient in Postgres and is recommended over varchar. It avoids having to put an arbitrary max length to strings.
-
- Nov 07, 2017
-
-
Benjamin Bertrand authored
-
- Nov 03, 2017
-
-
Benjamin Bertrand authored
CSE makes it clearer that it's linked to CSEntry
-
Benjamin Bertrand authored
-
- Oct 17, 2017
-
-
Benjamin Bertrand authored
This reverts commit 8d6acd19. See https://issues.jenkins-ci.org/browse/JENKINS-46736
-
- Sep 29, 2017
-
-
Benjamin Bertrand authored
Bug in bitbucket team project?
-
- Sep 26, 2017
-
-
Benjamin Bertrand authored
Client moved to its own repository (ics-inventory-client)
-
Benjamin Bertrand authored
Add button to return to main index
-
- Sep 25, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
-
- Sep 21, 2017
-
-
Benjamin Bertrand authored
ics_id, serial_number, manufacturer_id and model_id should not change. Repeating them in the history table takes space for nothing. We are only interested in tracking the status, location and parent.
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
- catch IntegrityError on patch - disable autoflush (IntegrityError was raised before commit due to autoflush)
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
-
- Sep 17, 2017
-
-
Benjamin Bertrand authored
Pass ?qrcode=true as query string
-
Benjamin Bertrand authored
-
- Sep 09, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
-