La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

from app import db
from import Post
class Program(Post):
__tablename__ = 'program'
__mapper_args__ = {'polymorphic_identity': __tablename__}
# ID of underlying Post object
id = db.Column(db.Integer, db.ForeignKey(''), primary_key=True)
# Program name
title = db.Column(db.Unicode(128))
# TODO: Category (games/utilities/lessons)
# TODO: Tags
# TODO: Compatible calculator models
thread_id = db.Column(db.Integer,db.ForeignKey(''),nullable=False)
thread = db.relationship('Thread', foreign_keys=thread_id,
# TODO: Number of views, statistics, attached files, etc
def __init__(self, author, title, thread):
Create a Program.
author -- post author (User, though only Members can post)
title -- program title (unicode string)
thread -- discussion thread attached to the topic
Post.__init__(self, author)
self.title = title
self.thread = thread
def from_topic(topic):
p = Program(, topic.title, topic.thread)
topic.promotion = p
def __repr__(self):
return f'<Program: #{} "{self.title}">'