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.

contents.py 675B

1234567891011121314151617181920
  1. from datetime import datetime
  2. from app import db
  3. from app.models.users import *
  4. class Content(db.Model):
  5. __tablename__ = 'content'
  6. id = db.Column(db.Integer, primary_key=True)
  7. type = db.Column(db.String(20))
  8. __mapper_args__ = {
  9. 'polymorphic_identity': __tablename__,
  10. 'polymorphic_on': type
  11. }
  12. # Standalone properties
  13. data = db.Column(db.Text(convert_unicode=True))
  14. date_created = db.Column(db.DateTime, default=datetime.now)
  15. date_modified = db.Column(db.DateTime, default=datetime.now)
  16. # Relationships
  17. author_id = db.Column(db.ForeignKey('user.id'))
  18. author = db.relationship("User", back_populates="contents")