mirror of
https://github.com/yweber/lodel2.git
synced 2026-03-21 02:22:02 +01:00
[ClassTypes et Fields] Mise en commentaire des imports obsolètes et conformité pep8/pylint
This commit is contained in:
parent
d169a9dd2e
commit
867ad023be
2 changed files with 11 additions and 11 deletions
|
|
@ -23,7 +23,7 @@ class EmNature(object):
|
||||||
# - 'attach' : what type of superior a type can have
|
# - 'attach' : what type of superior a type can have
|
||||||
# - 'classtype' a type can have superiors of the same classtype
|
# - 'classtype' a type can have superiors of the same classtype
|
||||||
# - 'type' a type can only have superiors of the same type
|
# - 'type' a type can only have superiors of the same type
|
||||||
# - automatic : possible superiors
|
# - automatic : possible superiors
|
||||||
# - False : possible superiors must be defined
|
# - False : possible superiors must be defined
|
||||||
# - True : possible superiors can not be defined, they will be enforced by the ME automatically
|
# - True : possible superiors can not be defined, they will be enforced by the ME automatically
|
||||||
# - maxdepth : maximum depth
|
# - maxdepth : maximum depth
|
||||||
|
|
@ -86,10 +86,9 @@ class EmClassType(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def natures(classtype_name):
|
def natures(classtype_name):
|
||||||
if not isinstance(classtype_name, str):
|
if not isinstance(classtype_name, str):
|
||||||
raise TypeError("Excepted <class str> but got "+str(type(classtype_name)))
|
raise TypeError("Excepted <class str> but got %s" % str(type(classtype_name)))
|
||||||
try:
|
try:
|
||||||
classtype = getattr(EmClassType, classtype_name)
|
classtype = getattr(EmClassType, classtype_name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise AttributeError("Unknown classtype : '"+classtype_name+"'")
|
raise AttributeError("Unknown classtype : '%s'" % classtype_name)
|
||||||
return classtype['hierarchy'].keys()
|
return classtype['hierarchy'].keys()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
#-*- coding: utf-8 -*-
|
#-*- coding: utf-8 -*-
|
||||||
|
|
||||||
from EditorialModel.components import EmComponent
|
from EditorialModel.components import EmComponent
|
||||||
from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon, get_field_type
|
from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon # , get_field_type
|
||||||
from EditorialModel.fieldgroups import EmFieldGroup
|
# from EditorialModel.fieldgroups import EmFieldGroup
|
||||||
from EditorialModel.classes import EmClass
|
# from EditorialModel.classes import EmClass
|
||||||
|
|
||||||
from Database import sqlutils
|
# from Database import sqlutils
|
||||||
from Database.sqlalter import DropColumn, AddColumn
|
# from Database.sqlalter import DropColumn, AddColumn
|
||||||
|
|
||||||
|
# import sqlalchemy as sql
|
||||||
|
|
||||||
import sqlalchemy as sql
|
|
||||||
|
|
||||||
## EmField (Class)
|
## EmField (Class)
|
||||||
#
|
#
|
||||||
|
|
@ -110,4 +111,4 @@ class EmField(EmComponent):
|
||||||
# res = conn.execute(req)
|
# res = conn.execute(req)
|
||||||
# row = res.fetchone()
|
# row = res.fetchone()
|
||||||
#</SQL>
|
#</SQL>
|
||||||
# return EmClass(row['class_id'])
|
# return EmClass(row['class_id'])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue