Guest User

Untitled

a guest
Dec 7th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. AttributeError: type object 'BaseModel' has no attribute 'Meta'
  2.  
  3. import peewee as pw
  4. class BaseModel(pw.Model):
  5. class Meta:
  6. database = pw.Proxy()
  7.  
  8. @classmethod
  9. def configure_proxy(cls, database: pw.Database):
  10. cls.Meta.database.initialize(database)
  11.  
  12. import peewee as pw
  13. class BaseModel(pw.Model):
  14. class MyMeta:
  15. database = pw.Proxy()
  16.  
  17. @classmethod
  18. def configure_proxy(cls, database: pw.Database):
  19. cls.MyMeta.database.initialize(database)
  20.  
  21. class BaseModel(pw.Model):
  22. class Meta:
  23. database = pw.Proxy()
  24.  
  25. @classmethod
  26. def configure_proxy(cls, database: pw.Database):
  27. cls._meta.database.initialize(database)
Add Comment
Please, Sign In to add comment