peewee.ImproperlyConfigured: database attribute does not appear to be set on the model: <Model: Branch>
First off, please take the time to format your code properly. GitHub has links and controls in the editor that will show you how to do this.

Second, please see the documentation. This is covered in all the basic examples.

http://docs.peewee-orm.com/en/latest/peewee/quickstart.html#model-definition

```python
class SomeModel(Model):
    ...
    class Meta:
        database = db_instance
```

from peewee import *
db = MySQLDatabase('library',user='root', password= '', host='localhost', port=3306 )





class Branch(Model):
    name = CharField()
    code = CharField(null=True,unique=True)
    location = CharField(null=True)




db.connect()

db.create_tables([Branch])


how to solve this issue?

Traceback (most recent call last):
  File "C:/Users/Mohammed/OneDrive - Office 365/Python Projects/Library/test.py", line 20, in <module>
    db.create_tables([Branch])
  File "C:\Users\Mohammed\AppData\Local\Programs\Python\Python38\lib\site-packages\peewee.py", line 3286, in create_tables
    model.create_table(**options)
  File "C:\Users\Mohammed\AppData\Local\Programs\Python\Python38\lib\site-packages\peewee.py", line 6590, in create_table
    if safe and not cls._schema.database.safe_create_index \
  File "C:\Users\Mohammed\AppData\Local\Programs\Python\Python38\lib\site-packages\peewee.py", line 5520, in database
    raise ImproperlyConfigured('database attribute does not appear to '
peewee.ImproperlyConfigured: database attribute does not appear to be set on the model: <Model: Branch>