Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Fix example plugin code in getting started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
z2s8 authored and cverna committed Mar 28, 2017
1 parent 6953301 commit cf19d68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion statscache/templates/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ <h4>extensibility</h4>
import sqlalchemy as sa

class Model(BaseModel):
__tablename__ = "data_popularity"
# inherited from BaseModel: timestamp = sa.Column(sa.DateTime, ...)
references = sa.Column(sa.Integer, nullable=False)
username = sa.Column(sa.UnicodeText, nullable=False, index=True)
Expand Down Expand Up @@ -102,7 +103,7 @@ <h4>extensibility</h4>
.filter(self.model.username == username)\
.order_by(self.model.timestamp.desc())\
.first()
session.add_row(self.model(
session.add(self.model(
timestamp=timestamp,
username=username,
references=getattr(previous, 'references', 0) + 1
Expand Down

0 comments on commit cf19d68

Please sign in to comment.