peewee.py 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from typing import Any, Optional, TypeVar, Type, List
  2. class Expression:
  3. pass
  4. T = TypeVar("T", bound="Model")
  5. class Model:
  6. id: int
  7. @classmethod
  8. def create(cls: Type[T], **kwargs) -> T:
  9. pass
  10. @classmethod
  11. def get(cls: Type[T], expr: Optional[Expression] = None, **kwargs) -> T:
  12. pass
  13. @classmethod
  14. def get_or_none(cls: Type[T], expr: Optional[Expression] = None, **kwargs) -> T:
  15. pass
  16. @classmethod
  17. def select(self, expr: Optional[Expression] = None):
  18. pass
  19. # These all do things that MyPy chokes on, so we're going to treat
  20. # them like methods instead of naming classes
  21. def TextField(unique: bool = False) -> Any:
  22. pass
  23. def DateTimeField(unique: bool = False) -> Any:
  24. pass
  25. def BooleanField(unique: bool = False) -> Any:
  26. pass
  27. def ForeignKeyField(key: object, null: bool = None, backref: str = "") -> Any:
  28. pass
  29. class IntegrityError(Exception):
  30. pass