Hi! i'm doing a final project for a university introduction course in web programmation.
I'v Coded this:
class MainHandler(BaseHandler):
def get(self):
#product_comments = Comments().get_all()
user = users.get_current_user()
if user:
member = Members().get_by_id(user.user_id())
baskets=Baskets().get_by_member(member)
template_args = {'baskets': baskets}
products = Products().get_all()
product_comments = []
for product in products:
comments = Comments().get_by_product(product)
product_comments.append(comments)
template_args = {'product_comments': product_comments}
self.render('main.html', template_args)
I've got this:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 634, in __call__
handler.get(*groups)
File "C:\Users\DACOT153\Desktop\ULaval\Session 6 - H2011\SIO - 3103 Z1 Introduction a la programmation Web\Exercice\GeekShop3\GeekShop3\src\handler_main.py", line 27, in get
baskets=Baskets().get_by_member(member)
UnboundLocalError: local variable 'member' referenced before assignment
I'm a newbie in programming and i really don't understand what's going on! can someone help please?
I use Python 2.5 and google App Engine
Thx!