1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-05-02 13:10:58 +02:00
Commit graph

47 commits

Author SHA1 Message Date
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
Yann
155e089750 Added some test for sql_wrapper alter schema functions 2015-05-29 10:41:26 +02:00
Yann
c7defe71e0 Added tests for sqlwrapper
Removed logging test in EditorialModel/lib/component.py
Added comment in Database/sqlwrapper.py
2015-05-28 17:41:45 +02:00
Yann
aad5586cb1 Updated sqlwrapper to enable sqlite support and logging enable/disable 2015-05-28 14:23:03 +02:00
ArnAud
4e2b85328c ME: installation of the basic tables 2015-05-27 16:48:51 +02:00
Yann
ebdb512500 Modification to be less dependent to django + logging in db wrapper 2015-05-27 15:05:05 +02:00
ArnAud
3ce6e1774e sqlWrapper: default attend un objet 2015-05-27 13:33:05 +02:00
Yann
07209417a7 Refactoring comments in db wrapper 2015-05-27 13:31:35 +02:00
ArnAud
3e80b68303 connection à une base de donnée 2015-05-27 11:57:16 +02:00
Roland Haroutiounian
966e16a2bb Paramétrage des noms de connexion dans le module Databases 2015-05-22 16:18:12 +02:00
Roland Haroutiounian
d8d0f9f303 Ajout du module Database 2015-05-22 12:22:16 +02:00