codesmidgen/codesmidgen/models.py

24 lines
666 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
2023-07-28 06:14:10 +00:00
from codesmidgen.db import Model, Column, Integer, String, Text, DateTime, Boolean
2016-01-08 21:41:24 +00:00
2023-07-28 06:14:10 +00:00
class Smidgen(Model):
2016-01-08 21:41:24 +00:00
"""
The main (only?) table in the system
"""
2023-07-28 06:14:10 +00:00
__tablename__ = 'smidgens'
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)