nft.py 901 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from optparse import Option
  2. from typing import Optional
  3. from pydantic import BaseModel
  4. # Shared properties
  5. class NftBase(BaseModel):
  6. hash: Optional[str] = None
  7. imgurl: Optional[str] = None
  8. userid: Optional[str] = None
  9. title: str
  10. context: Optional[str] = None
  11. is_active: Optional[bool] = True
  12. category: Optional[str] = None
  13. uid: Optional[str] = None
  14. id: int
  15. class Config:
  16. orm_mode = True
  17. class NftPrint(BaseModel):
  18. Nft: Optional[NftBase] = None
  19. count: Optional[int] = None
  20. class Config:
  21. orm_mode = True
  22. class NftCreate(NftBase):
  23. pass
  24. class NftUpdate(NftBase):
  25. pass
  26. class NftBulkUpdate(BaseModel):
  27. hash: Optional[str] = None
  28. imgurl: Optional[str] = None
  29. userid: Optional[str] = None
  30. title: str
  31. context: Optional[str] = None
  32. is_active: Optional[bool] = True
  33. category: Optional[str] = None