You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
512 B
Python
28 lines
512 B
Python
import peewee
|
|
|
|
|
|
DB_PROXY = peewee.Proxy()
|
|
|
|
|
|
class BaseModel(peewee.Model):
|
|
class Meta:
|
|
database = DB_PROXY
|
|
|
|
|
|
class Ordner(BaseModel):
|
|
id = peewee.AutoField()
|
|
parent = peewee.IntegerField()
|
|
name = peewee.TextField()
|
|
zuletzt_verwendet = peewee.TimestampField()
|
|
|
|
|
|
class Foto(BaseModel):
|
|
id = peewee.AutoField()
|
|
ordner = peewee.IntegerField()
|
|
name = peewee.CharField()
|
|
notiz = peewee.CharField() # 255?
|
|
|
|
|
|
def db_create_table():
|
|
DB_PROXY.create_tables([Ordner, Foto])
|