add profile visible flag

This commit is contained in:
2021-07-02 16:26:36 +02:00
parent 3b6225f621
commit 9f4795b9f1
4 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
from datetime import datetime
from sqlalchemy import Column, Integer, SmallInteger, String, DateTime, ForeignKey
from sqlalchemy import Boolean, Column, Integer, SmallInteger, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from app import db
@ -28,6 +28,7 @@ class Profile(db.Model):
pronouns = Column(String(25), default="")
volunteerwork = Column(String(4000), default="")
freetext = Column(String(4000), default="")
visible = Column(Boolean, nullable=False, default=False)
created = Column(DateTime, nullable=False, default=datetime.now)
updated = Column(DateTime, onupdate=datetime.now, nullable=False, default=datetime.now)
@ -44,6 +45,7 @@ class Profile(db.Model):
"pronouns": self.pronouns,
"volunteerwork": self.volunteerwork,
"freetext": self.freetext,
"visible": self.visible,
"address": self.address.to_dict(),
"contacts": list(map(lambda contact: contact.to_dict(), self.contacts)),
"skills": list(map(lambda skill: skill.to_dict(), self.skills)),