1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-12 08:59:16 +01:00

Ajout du Doxyfile et des entêtes de méthodes pour les objets EmField, EmFieldGroup et EmType

This commit is contained in:
Yann 2015-05-22 16:38:14 +02:00
commit df4c5cbfd8
4 changed files with 2662 additions and 0 deletions

2403
Doxyfile Normal file

File diff suppressed because it is too large Load diff

78
em/field.py Normal file
View file

@ -0,0 +1,78 @@
#-*- coding: utf-8 -*-
from component import EmComponent
"""Represent one data for a lodel2 document"""
class EmField(EmComponent):
def __init__(id_or_name):
""" Instanciate an EmType with data fetched from db
@param id_or_name str|int: Identify the EmType by name or by global_id
@throw TypeError
@see EmComponent::__init__()
"""
super(EmField, self).__init__()
pass
def create( name, em_fieldgroup, ml_repr = None, ml_help = None,
icon = None, optionnal = False, type_relation = None,
relationnal_field = None, primary_data = False,
default_value = None, params = None, value = None):
""" Create a new EmType and instanciate it
@todo Change the icon param type
@todo change staticmethod to classmethod ?
@todo simplify function aguments ?
@todo typeof default_value argument ?
@todo typeof params argument ?
@todo typeof value argument ?
@static
@param name str: The name of the new Type
@param em_fieldgroup EmFieldGroup: The new field will belong to this fieldgroup
@param ml_repr MlString|None: Multilingual representation of the type
@param ml_help MlString|None: Multilingual help for the type
@param The string|None: filename of the icon
@param optionnal bool: Is the field optionnal ?
@param type_relation EmType|None: If not None make a link between the class of the new EmField and this EmType
@param relationnal_field EmField|None: If not None indicates that the new field defines the relation created by this EmField argument
@param primary_data bool: Is the new field a primary data field ?
@param The default_value: field's default value
@param Params params: of the field
@param Value value: of the field
@throw TypeError
@see EmComponent::__init__()
@staticmethod
"""
pass
def set_default(default_value):
""" Set the default value
@todo argument type ?
@todo return type ?
@param default_value anytype: The default value
"""
pass
def set_param(params):
""" Set the field parameters
@todo argument type ? EmFieldParam ?
@todo return type ?
@param params anytype: The field parameters
"""
pass
def set_value(v):
""" Set the field value
@todo Better explanations
Don't set the field value in a document, it's a special kind of value
@param The v: value
"""
pass

53
em/fieldgroup.py Normal file
View file

@ -0,0 +1,53 @@
#-*- coding: utf-8 -*-
from component import EmComponent
class EmFieldGroup(EmComponent):
""" Represents groups of EmField
EmClass fields representation is organised with EmFieldGroup
@see EmField
"""
def __init__(id_or_name):
""" Instanciate an EmFieldGroupe with data fetched from db
@param id_or_name str|int: Identify the EmFieldGroup by name or by global_id
@throw TypeError
@see component::EmComponent::__init__()
"""
super(EmFieldGroup, self).__init__()
pass
def create(name, em_class, ml_repr = None, ml_help = None, icon = None):
""" Create a new EmType and instanciate it
@todo Change the icon param type
@todo em_class == None => Error ?
@todo change staticmethod to classmethod ?
@param name str: The name of the new Type
@param em_class EmClass: The new EmFieldGroup will belong to this class
@param ml_repr MlString|None: Multilingual representation of the type
@param ml_help MlString|None: Multilingual help for the type
@param The string|None: filename of the icon
@return An EmFieldGroup instance
@see EmComponent::__init__()
@staticmethod
"""
pass
def fields():
""" Get the list of associated fields
@return A list of EmField
"""
pass
def field():
""" ???
@todo : find what this function is for
"""
pass

128
em/type.py Normal file
View file

@ -0,0 +1,128 @@
#-*- coding: utf-8 -*-
from component import EmComponent
class EmType(EmComponent):
""" Represents type of documents
A type is a specialisation of a class, it can select optional field,
they have hooks, are organized in hierarchy and linked to other
EmType with special fields called relation_to_type fields
@see EmComponent
"""
def __init__(id_or_name):
""" Instanciate an EmType with data fetched from db
@param id_or_name str|int: Identify the EmType by name or by global_id
@throw TypeError
@see EmComponent::__init__()
"""
super(EmType, self).__init__()
pass
@staticmethod
def create(name, em_class, ml_repr = None, ml_help = None, icon = None, sort_field = None):
""" Create a new EmType and instanciate it
@param name str: The name of the new type
@param em_class EmClass: The class that the new type will specialize
@param ml_repr MlString: Multilingual representation of the type
@param ml_help MlString: Multilingual help for the type
@param icon str|None: The filename of the icon
@param sort_field EmField|None: The field used to sort by default
@see EmComponent::__init__()
@todo Change the icon param type
@todo change staticmethod to classmethod
"""
pass
def field_groups():
""" Get the list of associated fieldgroups
@return A list of EmFieldGroup
"""
pass
def fields():
""" Get the list of associated fields
@return A list of EmField
"""
pass
def select_field(field):
""" Indicate that an optionnal field is used
@param field EmField: The optional field to select
@throw ValueError, TypeError
@todo change exception type and define return value and raise condition
"""
pass
def unselect_field(field):
""" Indicate that an optionnal field will not be used
@param field EmField: The optional field to unselect
@throw ValueError, TypeError
@todo change exception type and define return value and raise condition
"""
pass
def hooks():
"""Get the list of associated hooks"""
pass
def add_hook(hook):
""" Add a new hook
@param hook EmHook: A EmHook instance
@throw TypeError
"""
pass
def del_hook(hook):
""" Delete a hook
@param hook EmHook: A EmHook instance
@throw TypeError
@todo Maybe we don't need a EmHook instance but just a hook identifier
"""
pass
def superiors():
""" Get the list of superiors EmType in the type hierarchy
@return A list of EmType
"""
pass
def add_superior(em_type, relation_nature):
""" Add a superior in the type hierarchy
@param em_type EmType: An EmType instance
@param relation_nature str: The name of the relation's nature
@throw TypeError
@todo define return value and raise condition
"""
pass
def del_superior(em_type):
""" Delete a superior in the type hierarchy
@param em_type EmType: An EmType instance
@throw TypeError
@todo define return value and raise condition
"""
pass
def linked_types():
""" Get the list of linked type
Types are linked with special fields called relation_to_type fields
@return a list of EmType
@see EmFields
"""
pass