article update

This commit is contained in:
Andreas Stephanides
2017-01-16 13:24:19 +01:00
parent 9dc49e83df
commit 7e90ce324d
3 changed files with 9 additions and 4 deletions

View File

@@ -30,7 +30,13 @@ class Section(Base):
def __init__(self, url=None,fname=None):
self.url=url
self.foreign_name=fname
def title(self):
t=self.name
if t == None or t.strip()=="":
t=self.foreign_name
return t
@classmethod
def find_or_create(cls, fname):
s=Section.query.filter(Section.foreign_name==fname).first()