Skip to content

Fields custom getters and setters #26

Description

@rmk135

The idea is to create functionality for specification of custom getters and setters for domain model fields.

class Profile(models.DomainModel):

    id = fields.Int()
    open_id = fields.Int()

    @open_id.getter
    def _get_oid(self):
        return self.id >> 8 

    @open_id.setter
    def _set_oid(self, value):
        self.id = value << 8

Notes:

  • If custom getter / setter is specified, it completely replaces field's getter / setter logic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions