mirror of
https://github.com/yweber/lodel2.git
synced 2025-10-30 02:59:03 +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
|
||||
# - 'classtype' a type can have superiors of the same classtype
|
||||
# - 'type' a type can only have superiors of the same type
|
||||
# - automatic : possible superiors
|
||||
# - automatic : possible superiors
|
||||
# - False : possible superiors must be defined
|
||||
# - True : possible superiors can not be defined, they will be enforced by the ME automatically
|
||||
# - maxdepth : maximum depth
|
||||
|
|
@ -86,10 +86,9 @@ class EmClassType(object):
|
|||
@staticmethod
|
||||
def natures(classtype_name):
|
||||
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:
|
||||
classtype = getattr(EmClassType, classtype_name)
|
||||
except AttributeError:
|
||||
raise AttributeError("Unknown classtype : '"+classtype_name+"'")
|
||||
raise AttributeError("Unknown classtype : '%s'" % classtype_name)
|
||||
return classtype['hierarchy'].keys()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
#-*- coding: utf-8 -*-
|
||||
|
||||
from EditorialModel.components import EmComponent
|
||||
from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon, get_field_type
|
||||
from EditorialModel.fieldgroups import EmFieldGroup
|
||||
from EditorialModel.classes import EmClass
|
||||
from EditorialModel.fieldtypes import EmField_boolean, EmField_char, EmField_integer, EmField_icon # , get_field_type
|
||||
# from EditorialModel.fieldgroups import EmFieldGroup
|
||||
# from EditorialModel.classes import EmClass
|
||||
|
||||
from Database import sqlutils
|
||||
from Database.sqlalter import DropColumn, AddColumn
|
||||
# from Database import sqlutils
|
||||
# from Database.sqlalter import DropColumn, AddColumn
|
||||
|
||||
# import sqlalchemy as sql
|
||||
|
||||
import sqlalchemy as sql
|
||||
|
||||
## EmField (Class)
|
||||
#
|
||||
|
|
@ -110,4 +111,4 @@ class EmField(EmComponent):
|
|||
# res = conn.execute(req)
|
||||
# row = res.fetchone()
|
||||
#</SQL>
|
||||
# return EmClass(row['class_id'])
|
||||
# return EmClass(row['class_id'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue