codesmidgen/stickynotes/models.py

24 lines
673 B
Python

# -*- coding: utf-8 -*-
"""
The models in use
"""
from datetime import datetime
from stickynotes.db import Model, Column, Integer, String, Text, DateTime, Boolean
class StickyNote(Model):
"""
The main (only?) table in the system
"""
__tablename__ = 'sticky_notes'
id = Column(Integer, autoincrement=True, primary_key=True)
title = Column(String(255))
source = Column(Text)
lexer = Column(String(255), default='text')
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)