WIP
This commit is contained in:
parent
637b00261a
commit
3c4a25e5ad
17 changed files with 197 additions and 272 deletions
26
app/model/comment.py
Normal file
26
app/model/comment.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
from peewee import Model
|
||||
from peewee import CharField
|
||||
from peewee import TextField
|
||||
from peewee import DateTimeField
|
||||
from peewee import ForeignKeyField
|
||||
from model.site import Site
|
||||
from core.database import get_db
|
||||
|
||||
|
||||
class Comment(Model):
|
||||
url = CharField()
|
||||
created = DateTimeField()
|
||||
notified = DateTimeField(null=True,default=None)
|
||||
published = DateTimeField(null=True, default=None)
|
||||
author_name = CharField()
|
||||
author_site = CharField(default='')
|
||||
author_gravatar = CharField(default='')
|
||||
ip = CharField(default='')
|
||||
content = TextField()
|
||||
site = ForeignKeyField(Site, related_name='site')
|
||||
|
||||
class Meta:
|
||||
database = get_db()
|
||||
16
app/model/site.py
Normal file
16
app/model/site.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
from peewee import Model
|
||||
from peewee import CharField
|
||||
from core.database import get_db
|
||||
|
||||
|
||||
class Site(Model):
|
||||
name = CharField(unique=True)
|
||||
url = CharField()
|
||||
token = CharField()
|
||||
admin_email = CharField()
|
||||
|
||||
class Meta:
|
||||
database = get_db()
|
||||
Loading…
Add table
Add a link
Reference in a new issue