1. Aiogram

Aiogram fields

Fields

BaseField

classaiogram.types.fields.BaseField(*base=Nonedefault=Nonealias=Noneon_change=None)[source]

Bases: object

Base field (prop)

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

get_value(instance)[source]

Get value for the current object instanceParameters

instance –Returnsset_value(instancevalueparent=None)[source]

Set prop valueParameters

  • instance –
  • value –
  • parent –

Returnsabstractserialize(value)[source]

Serialize value to pythonParameters

value –Returnsabstractdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject valueexport(instance)[source]

Alias for serialize but for current Object instanceParameters

instance –Returns

Field

classaiogram.types.fields.Field(*base=Nonedefault=Nonealias=Noneon_change=None)[source]

Bases: BaseField

Simple field

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

serialize(value)[source]

Serialize value to pythonParameters

value –Returnsdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject value

ListField

classaiogram.types.fields.ListField(*args**kwargs)[source]

Bases: Field

The field contains a list of objects

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

serialize(value)[source]

Serialize value to pythonParameters

value –Returnsdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject value

ListOfLists

classaiogram.types.fields.ListOfLists(*base=Nonedefault=Nonealias=Noneon_change=None)[source]

Bases: Field

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

serialize(value)[source]

Serialize value to pythonParameters

value –Returnsdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject value

DateTimeField

classaiogram.types.fields.DateTimeField(*base=Nonedefault=Nonealias=Noneon_change=None)[source]

Bases: Field

In this field stored datetime

in: unixtime out: datetime

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

serialize(value: datetime)[source]

Serialize value to pythonParameters

value –Returnsdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject value

TextField

classaiogram.types.fields.TextField(*prefix=Nonesuffix=Nonedefault=Nonealias=None)[source]

Bases: Field

Init propParameters

  • base – class for child element
  • default – default value
  • alias – alias name (for e.g. field ‘from’ has to be named ‘from_user’ as ‘from’ is a builtin Python keyword
  • on_change – callback will be called when value is changed

serialize(value)[source]

Serialize value to pythonParameters

value –Returnsdeserialize(valueparent=None)[source]

Deserialize python object value to TelegramObject value