Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'Counter' is not defined in example #2646

Closed
stefaneidelloth opened this issue Nov 10, 2022 · 2 comments
Closed

NameError: name 'Counter' is not defined in example #2646

stefaneidelloth opened this issue Nov 10, 2022 · 2 comments

Comments

@stefaneidelloth
Copy link


NameError Traceback (most recent call last)
Cell In [7], line 35
28 users = (User
29 .select(User, tweet_ct.alias('ct'))
30 .join(Tweet, JOIN.LEFT_OUTER)
31 .group_by(User)
32 .order_by(tweet_ct.desc()))
34 # Do an atomic update
---> 35 Counter.update(count=Counter.count + 1).where(Counter.url == request.url)

NameError: name 'Counter' is not defined

@coleifer
Copy link
Owner

Yeah the readme is just showing that to illustrate a point. It's hopefully obvious what the intent is.

@stefaneidelloth
Copy link
Author

stefaneidelloth commented Nov 10, 2022

No, its not. I thought Counter is a missing Class that is also mapped to the database or there is a missing import.

coleifer added a commit that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants