mirror of
https://github.com/yweber/lodel2.git
synced 2026-02-03 17:50:12 +01:00
Updated comments (and deleting space between ## and @brief )
This commit is contained in:
parent
8dbe6b6234
commit
c5971d9590
23 changed files with 322 additions and 239 deletions
|
|
@ -3,13 +3,13 @@ import warnings
|
|||
|
||||
from lodel.leapi.datahandlers.base_classes import DataField
|
||||
|
||||
## @brief Data field designed to handle boolean values
|
||||
##@brief Data field designed to handle boolean values
|
||||
class Boolean(DataField):
|
||||
|
||||
help = 'A basic boolean field'
|
||||
base_type = 'bool'
|
||||
|
||||
## @brief A boolean field
|
||||
##@brief A boolean field
|
||||
def __init__(self, **kwargs):
|
||||
if 'check_data_value' not in kwargs:
|
||||
kwargs['check_data_value'] = self.check_value
|
||||
|
|
@ -23,7 +23,7 @@ class Boolean(DataField):
|
|||
error = TypeError("The value '%s' is not, and will never, be a boolean" % value)
|
||||
return value, error
|
||||
|
||||
## @brief Data field designed to handle integer values
|
||||
##@brief Data field designed to handle integer values
|
||||
class Integer(DataField):
|
||||
|
||||
help = 'Basic integer field'
|
||||
|
|
@ -40,19 +40,19 @@ class Integer(DataField):
|
|||
error = TypeError("The value '%s' is not, and will never, be an integer" % value)
|
||||
return value, error
|
||||
|
||||
## @brief Data field designed to handle string
|
||||
##@brief Data field designed to handle string
|
||||
class Varchar(DataField):
|
||||
|
||||
help = 'Basic string (varchar) field. Default size is 64 characters'
|
||||
base_type = 'char'
|
||||
|
||||
## @brief A string field
|
||||
##@brief A string field
|
||||
# @brief max_length int: The maximum length of this field
|
||||
def __init__(self, max_length=64, **kwargs):
|
||||
self.max_length = int(max_length)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
## @brief checks if this class can override the given data handler
|
||||
##@brief checks if this class can override the given data handler
|
||||
# @param data_handler DataHandler
|
||||
# @return bool
|
||||
def can_override(self, data_handler):
|
||||
|
|
@ -62,13 +62,13 @@ class Varchar(DataField):
|
|||
return False
|
||||
return True
|
||||
|
||||
## @brief Data field designed to handle date & time
|
||||
##@brief Data field designed to handle date & time
|
||||
class DateTime(DataField):
|
||||
|
||||
help = 'A datetime field. Take two boolean options now_on_update and now_on_create'
|
||||
base_type = 'datetime'
|
||||
|
||||
## @brief A datetime field
|
||||
##@brief A datetime field
|
||||
# @param now_on_update bool : If true, the date is set to NOW on update
|
||||
# @param now_on_create bool : If true, the date is set to NEW on creation
|
||||
# @param **kwargs
|
||||
|
|
@ -77,7 +77,7 @@ class DateTime(DataField):
|
|||
self.now_on_create = now_on_create
|
||||
super().__init__(**kwargs)
|
||||
|
||||
## @brief Data field designed to handle long string
|
||||
##@brief Data field designed to handle long string
|
||||
class Text(DataField):
|
||||
help = 'A text field (big string)'
|
||||
base_type = 'text'
|
||||
|
|
@ -85,12 +85,12 @@ class Text(DataField):
|
|||
def __init__(self, **kwargs):
|
||||
super(self.__class__, self).__init__(ftype='text', **kwargs)
|
||||
|
||||
## @brief Data field designed to handle Files
|
||||
##@brief Data field designed to handle Files
|
||||
class File(DataField):
|
||||
|
||||
base_type = 'file'
|
||||
|
||||
## @brief a file field
|
||||
##@brief a file field
|
||||
# @param upload_path str : None by default
|
||||
# @param **kwargs
|
||||
def __init__(self, upload_path=None, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue