codesmidgen/stickynotes/models.py

24 lines
673 B
Python
Raw Normal View History

2016-01-08 21:41:24 +00:00
# -*- coding: utf-8 -*-
"""
The models in use
"""
from datetime import datetime
from stickynotes.db import Model, Column, Integer, String, Text, DateTime, Boolean
2016-01-08 21:41:24 +00:00
class StickyNote(Model):
2016-01-08 21:41:24 +00:00
"""
The main (only?) table in the system
"""
__tablename__ = 'sticky_notes'
2016-01-08 21:41:24 +00:00
id = Column(Integer, autoincrement=True, primary_key=True)
title = Column(String(255))
source = Column(Text)
lexer = Column(String(255), default='text')
2016-01-08 21:41:24 +00:00
created = Column(DateTime, default=datetime.now, index=True)
expiry = Column(DateTime, default=None, index=True)
url = Column(String(255), index=True)
private = Column(Boolean, default=False, index=True)