Getting a NameError: global name 'Lesson' is not defined

2008-10-28 Thread Daniel Strasser
Hello Djangonauts, I get a NameError and I don't know why, I'm really getting mad. What I want to do is to list the number of Lessons a Student has passed. My schoolutil/student model looks like this: from django.db import models from schoolutil.lesson.models import * class Student(models.Mode

Re: Getting a NameError: global name 'Lesson' is not defined

2008-10-28 Thread Daniel Strasser
Hi Daniel > This is why it's a bad idea to do from x import *. You should always > import the things you need explicitly, then you can tell what's going > wrong. Try doing > from schoolutil.lesson.models import Lesson > and see if it still goes wrong - or if you get a more informative > error mes

Re: Getting a NameError: global name 'Lesson' is not defined

2008-10-28 Thread Daniel Strasser
> You have a circular reference between students.models and > lessons.models. The first want to import the second, which want to > import the first, etc... This just can't work. Thank you very much. I played around but I don't come to a solution. I think I'll try again. I just don't understand wh

Re: Getting a NameError: global name 'Lesson' is not defined

2008-10-29 Thread Daniel Strasser
Thank you very much for your precise answer. I think I misunderstood a lot and I will go through the tutorial again. On 28 Okt., 15:04, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 28 oct, 14:05,DanielStrasser<[EMAIL PROTECTED]> wrote: > > > > You have a circular reference between students

How can I get the user ID of the currently logged-in user?

2009-04-25 Thread Daniel Strasser
Hey I have been searching for a while for this, but I didn't came to a solution. I use the Django Authentication framework. In a view, I have: def settings(request): cust = Customer.objects.get(???) return render_to_response('useraccount/settings.html', {'loggedin': checklogin(r

Re: How can I get the user ID of the currently logged-in user?

2009-04-25 Thread Daniel Strasser
> So request.user.id will give you the userid of the currently loggedin user. aaah. thank you very much! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

What Django version should I use?

2008-05-05 Thread Daniel Strasser
Hi there I'm new to both Django and Python, but I'm so fascinated about Django that I don't want to use PHP for a new project that is coming up soon. Now I'm playing around with the latest "stable" release of Django (0.96), but both the tutorials and the documentation expects that you are using