This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/resources/user/models.pyi

40 lines
1.2 KiB
Python
Raw Normal View History

from typing import Set, Union
from uuid import UUID
from sqlalchemy import Column
2019-01-23 15:55:04 +00:00
from sqlalchemy.orm import relationship
from sqlalchemy_utils import Password
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.agent.models import Individual
2019-01-23 15:55:04 +00:00
from ereuse_devicehub.resources.inventory import Inventory
from ereuse_devicehub.resources.models import Thing
class User(Thing):
id = ... # type: Column
email = ... # type: Column
password = ... # type: Column
token = ... # type: Column
2019-01-23 15:55:04 +00:00
inventories = ... # type: relationship
ethereum_address = ... # type: Column
2019-01-23 15:55:04 +00:00
def __init__(self, email: str, password: str = None,
inventories: Set[Inventory] = None) -> None:
super().__init__()
self.id = ... # type: UUID
self.email = ... # type: str
self.password = ... # type: Password
self.individuals = ... # type: Set[Individual]
self.token = ... # type: UUID
2019-01-23 15:55:04 +00:00
self.inventories = ... # type: Set[Inventory]
self.ethereum_address = ... # type: str
@property
def individual(self) -> Union[Individual, None]:
pass
class UserInventory(db.Model):
pass