daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top