1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-04-30 04:00:57 +02:00
Commit graph

60 commits

Author SHA1 Message Date
Roland Haroutiounian
700c63d925 [doxygen] Réécriture de la doc sur des méthodes de sqlsetup.py 2015-07-10 09:06:51 +02:00
Roland Haroutiounian
c6204638fa [pep8] Lignes vides entre méthodes dans sqlutils.py 2015-07-10 09:02:59 +02:00
Yann
889abc8547 Put the database configuration asinstance attribute of EmComponent 2015-07-09 17:30:21 +02:00
Roland Haroutiounian
1d08100c10 [TODO] Suppression d'un TODO dans sqlsetup 2015-07-03 09:35:21 +02:00
Roland Haroutiounian
2f4497dfb9 [TODO] Suppression des TODO dans sqlsettings 2015-07-03 09:32:04 +02:00
Roland Haroutiounian
b03958a65a Suppression de sqlutils.getEngine au profit de sqlutils.get_engine 2015-07-02 17:03:54 +02:00
Roland Haroutiounian
9cc3f9ce12 PEP8 sur sqlalter.py 2015-07-02 16:47:51 +02:00
Roland Haroutiounian
4efea40abf Ajout d'un encoding sur un init 2015-07-02 16:47:51 +02:00
Roland Haroutiounian
3f4ee09c9f Normalisation PEP8/Pylint sur sqlsetup.py 2015-07-02 16:47:51 +02:00
Roland Haroutiounian
b774d33fae Nettoyage et mise en conformité PEP 8 de sqlutils.py 2015-07-02 16:47:51 +02:00
Roland Haroutiounian
2bae702a8b Ajout de l'alias get_engine dans sqlutils.py 2015-07-02 16:47:51 +02:00
Roland Haroutiounian
1796990944 [PEP8] Nettoyage de Database/sqlutils.py 2015-07-02 16:47:51 +02:00
Yann
6af0b45f3f Code factorization on EmType select and unselect fields. Added comparison capabilities to EmComponent (and childs)
Implemented __hash__ and __eq__ for EmComponent (based on class name and uid) to test equality betwenn two instance. Allows to use "instance in instance_list" syntax
2015-07-02 14:35:43 +02:00
Yann
a3b9daf319 sqlwrapper deletion and sqlsetup enhancement
Moved the database initialisation functionnality to sqlsetup and fixed all the code to handle the sqlwrapper deletion
2015-07-01 16:22:10 +02:00
Yann
4fb2f789b5 Replacing EmComponent method getDbE by db_engine 2015-07-01 12:35:18 +02:00
Yann
16a962fb3f Implemented DropColumn for sqlite 2015-06-26 16:03:38 +02:00
Yann
6359adc0f4 Added tests for EmField.delete() and EmClass.delete()
Also add a new function is sqlutils to execute ddl
2015-06-26 11:41:42 +02:00
Yann
027fcb974c Implemented EmType hierarchy, added utility function to classtype, changed pk for em_type_hierarchy table
EmType hierarchy is handled by 3 functions :
	- EmType.superiors()
	- EmType.subordinates()
	- EmType.add_superior(em_type, nature)
	- EmType.del_superior(em_type, nature)
Hierarchy implementation is not tested (because their is no tests...)

Added a function to get authorized relation nature from an EmClassType
Added the nature of a relation to the primary key of em_type_hierarchy table (triple pk : sup_id, sub_id, nature)
2015-06-24 12:09:01 +02:00
Roland Haroutiounian
0c05c66fa6 [#12] Correction sur un cast de variable 2015-06-19 17:09:18 +02:00
Yann
b45e7ea4ee Added an getTable function to sqlutils
It takes an EmComponent child class as parameter and return an sqlalchemy Table
2015-06-19 16:12:40 +02:00
Roland Haroutiounian
21f79a9301 [#11] Ajout de la génération de la colonne du Field dans la table correspondante 2015-06-19 10:31:58 +02:00
Yann
a9757a4672 Disabling annoying warnings in sqlwrapper and fixing a bug in test_components
Using sqlite db in test_components
2015-06-18 11:58:06 +02:00
Yann
e74623b1a4 Disabling an annoying warning when using reflect=True in MetaData instanciation 2015-06-11 13:29:02 +02:00
Yann
f26e87f621 Adding default date for date_create and date_update columns
The dates are set in EmComponent::create() for date_create and in EmComponent::save() for date_update
The values are sets to datetime.datetime.utcnow() so we now that EVERY date in the db are in UTC, no matter django, database or even server configurations.
We will have to take care to convert dates from database to django timezone in dates fieldtypes.
2015-06-11 12:17:29 +02:00
Yann
c100dd43f3 Adding default date for date_create and date_update columns
The dates are set in EmComponent::create() for date_create and in EmComponent::save() for date_update
The values are sets to datetime.datetime.utcnow() so we now that EVERY date in the db are in UTC, no matter django, database or even server configurations.
We will have to take care to convert dates from database to django timezone in dates fieldtypes.
2015-06-11 12:06:53 +02:00
Yann
7fb90e3045 Set some FK of EmField to NULL by default 2015-06-05 17:00:33 +02:00
Yann
f958efbff5 Code factorisation for new UID creation
Added a classmethod EmComponent::newUid() that determines the caller's class and return a newly registrated UID
2015-06-05 16:46:02 +02:00
Yann
c4e1afd192 More SQL isolation and some little bugfixes 2015-06-05 16:19:48 +02:00
Yann
5361ddc94a Merge branch 'master' of git.labocleo.org:lodel2 2015-06-05 14:45:20 +02:00
Yann
493149cfeb Added sqlutils functions 2015-06-05 14:45:00 +02:00
ArnAud
0f66161eaa fieldtype becomes a named variable instead of an integer 2015-06-05 14:42:01 +02:00
ArnAud
fa9b842a3d all uids ar integers 2015-06-05 14:38:38 +02:00
Yann
c901e7a643 Bugfixes in sqlsetup
Put every uid columns and associated FK in INTEGER instead of VARCHAR(50)
2015-06-05 14:23:22 +02:00
Yann
fff0225428 Merge branch 'sqlwrapper' 2015-06-05 11:07:02 +02:00
Yann
8fc072f6ee Cleaning and changin some methods name in sqlwrapper 2015-06-05 11:06:29 +02:00
Yann
2af27292c7 Merge branch 'sqlwrapper' of git.labocleo.org:lodel2 into sqlwrapper 2015-06-04 16:11:32 +02:00
Yann
6ab79eb412 Implemented alter table in sqlwrapper
Adding a column is implemented for mysql, postgresql and sqlite.
Droping and altering a column is only implemented for mysql and postgresql for the moment.

Quick&dirty tests has been done  for sqlite and mysql only.
2015-06-04 16:07:31 +02:00
Driky
49994da98f Prise en charge de la clause bindparam dans sqlquerybuilder.py
To-Do: tester
2015-06-03 16:48:47 +02:00
Driky
f937a63b53 Ajout de insert et delete dans sqlquerybuilder.py
To-do: prendre en charge le cas de execute ou une query a des parametre binder et une liste de dictionnaire est envoyé en param
2015-06-03 16:34:17 +02:00
Driky
d66ccfc431 sqlobject.py renommer en sqlquerybuilder.py
Implementation d'alias au ordre sqlalchemy: select, select_from, where, update, execute
To-Do: implemente insert et delete, tester.
2015-06-03 16:09:11 +02:00
ArnAud
58a4d7c681 Schéma: uid as integer, no column named 'class' 2015-06-03 15:42:12 +02:00
Yann
b82ccd7911 Allow to use SqlWrapper.createTable without being called by SqlWrapper.createAllFromConf 2015-06-03 15:13:43 +02:00
Yann
ddfbb2b056 Modified SqlWrapper to handle SqlSetup script
Now SQLSetup in able (via initDb) to initialize the database.
WARNING : initDb start by droping all tables in database before creating the new ones
2015-06-03 15:01:37 +02:00
Yann
dde02cadd0 New version of sqlwrapper that is not a singleton anymore 2015-06-03 13:39:03 +02:00
Yann
1a6a367481 Removed lines cut after 72 chars 2015-06-03 10:03:41 +02:00
Yann
9896c16e8e Small bugfixes in sqlobject and sqlwrapper 2015-06-03 09:30:12 +02:00
Yann
59f75eddbd Merge branch 'sqlwrapper_obj' for bugfixes 2015-05-29 16:15:32 +02:00
Yann
4120a45fff Bugfixes in sqlwrapper 2015-05-29 16:14:49 +02:00
Yann
7de456c41c Merge branch 'master' of git.labocleo.org:lodel2 2015-05-29 16:05:26 +02:00
Yann
a25e97607c Updated version of the sqlwrapper 2015-05-29 16:03:01 +02:00