422 rows = [headers]
423 for follower in followers:
424 column = [follower.user.public_name if follower.user.public_name else '']
425 column.append(follower.user._email if follower.user._email else '')426 column.append(
427 follower.created_at.strftime('%B %-d, %Y %H:%M %z')
428 if follower.created_at
422 rows = [headers]
423 for follower in followers:
424 column = [follower.user.public_name if follower.user.public_name else '']
425 column.append(follower.user._email if follower.user._email else '')426 column.append(
427 follower.created_at.strftime('%B %-d, %Y %H:%M %z')
428 if follower.created_at
57 # Get all the models in the db, all models should have a explicit __tablename__
58 classes, models, table_names = [], [], []
59 # noinspection PyProtectedMember
60 for class_ in list(db.Model._decl_class_registry.values()):61 try:
62 table_names.append(class_.__tablename__)
63 classes.append(class_)
124 # Get all the models in the db, all models should have a explicit __tablename__
125 classes, models, table_names = [], [], []
126 # noinspection PyProtectedMember
127 for class_ in list(db.Model._decl_class_registry.values()):128 try:
129 table_names.append(class_.__tablename__)
130 classes.append(class_)
15 from objproxies import CallbackProxy
16
17 db._session = db.session
18 db.session = CallbackProxy(lambda: db._session)
Accessing a protected member (a member prefixed with _
) of a class from outside that class is not recommended, since the creator of that class did not intend this member to be exposed. If accesing this attribute outside of the class is absolutely needed, refactor it such that it becomes part of the public interface of the class.
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
r = Rectangle(4, 8)
area = r._height * r._width
class Rectangle(object):
def __init__(self, height, width):
self._height = height
self._width = width
def area():
return self._height * self._width
r = Rectangle(4, 8)
area = r.area()