Fields

BooleanField

class highton.fields.boolean_field.BooleanField(name, required=False)[source]

The BooleanField represents a field which value will be parsed to Highrise specific boolean format

FALSE = 'false'
MAPPING = {False: 'false', True: 'true'}
TRUE = 'true'
decode(element)[source]
Parameters:element (xml.etree.ElementTree.Element) – the element which needs to be parsed
Returns:datetime.date
Return type:the parsed date object
encode()[source]
Returns:
Return type:xml.etree.ElementTree.Element
to_serializable_value()

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any

DateField

class highton.fields.date_field.DateField(name, required=False)[source]

The DateField represents a field which value will be parsed to Highrise specific date format

DATE_FORMAT = '%Y-%m-%d'
decode(element)[source]
Parameters:element (xml.etree.ElementTree.Element) – the element which needs to be parsed
Returns:datetime.date
Return type:the parsed date object
encode()[source]
Returns:
Return type:xml.etree.ElementTree.Element
to_serializable_value()

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any

DateTimeField

class highton.fields.datetime_field.DatetimeField(name, required=False)[source]
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
decode(element)[source]
Parameters:element (xml.etree.ElementTree.Element) – the element which needs to be parsed
Returns:the parsed datetime object
Return type:datetime.datetime
encode()[source]
Returns:the encoded element
Return type:xml.etree.ElementTree.Element
to_serializable_value()

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any

Field

class highton.fields.field.Field(name, required=False)[source]

This is an abstract class for a field, which makes the base for an encode and decode method

Variables:
  • name – name of the field which needed to serialize this field to a xml object
  • required – if the field is required when you create or update an object
  • value – the value of the field
decode(element)[source]

Decodes the value of the element

Parameters:element
Returns:
Return type:
encode()[source]

Encodes the value of the field and put it in the element also make the check for nil=true if there is one

Returns:returns the encoded element
Return type:xml.etree.ElementTree.Element
to_serializable_value()[source]

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any

IntegerField

class highton.fields.integer_field.IntegerField(name, required=False)[source]
decode(element)[source]
Parameters:element (xml.etree.ElementTree.Element) –
Returns:the parsed int object
Return type:int
encode()[source]
Returns:
Return type:xml.etree.ElementTree.Element
to_serializable_value()

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any

ListField

class highton.fields.list_field.ListField(name, init_class)[source]

The ListField parses the init_class objects in a list

Variables:init_class – a Highton model
decode(element)[source]
Parameters:element
Returns:the parsed list with init_class objects
Return type:list
encode()[source]

Just iterate over the child elements and append them to the current element

Returns:the encoded element
Return type:xml.etree.ElementTree.Element
to_serializable_value()[source]

Run through the values and parse them to a serializable value

Returns:
Return type:list

ObjectField

class highton.fields.object_field.ObjectField(name, init_class)[source]

The ObjectFIeld parses the init_class object

Variables:init_class – a Highton model
decode(element)[source]

Decodes the value of the element

Parameters:element
Returns:
Return type:
encode()[source]

Just encode the object you have as value

Returns:the parsed element
Return type:xml.etree.ElementTree.Element
to_serializable_value()[source]

Run through all fields of the object and parse the values

Returns:
Return type:dict

StringField

class highton.fields.string_field.StringField(name, required=False)[source]
decode(element)

Decodes the value of the element

Parameters:element
Returns:
Return type:
encode()

Encodes the value of the field and put it in the element also make the check for nil=true if there is one

Returns:returns the encoded element
Return type:xml.etree.ElementTree.Element
to_serializable_value()

Parse the value to a serializable pythonic value Default: Just return the value

Returns:
Return type:Any