Re: Hooking up Users and Profiles

2008-06-24 Thread radioflyer
On Jun 24, 4:05 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 2:53 PM, radioflyer <[EMAIL PROTECTED]> wrote: > > I continue to struggle with what I see as some real limitations of the > > User/UserProfile paradigm used by Dja

Hooking up Users and Profiles

2008-06-24 Thread radioflyer
I continue to struggle with what I see as some real limitations of the User/UserProfile paradigm used by Django. The recommended policy of setting AUTH_PROFILE_MODULE works alright for situations where the applications in your site only have need of a single user type. I've been working on a pro

Re: Title: Once again, subclassing User, UserProfile, Multiple User types...

2008-06-18 Thread radioflyer
On Jun 16, 8:10 pm, Etienne Robillard <[EMAIL PROTECTED]> wrote: > On Mon, 16 Jun 2008 11:58:48 -0700 (PDT) > > > > radioflyer <[EMAIL PROTECTED]> wrote: > > > I've spent quite a lot of time reading through information about > > extending Dja

Title: Once again, subclassing User, UserProfile, Multiple User types...

2008-06-16 Thread radioflyer
I've spent quite a lot of time reading through information about extending Django's User model. I've read the arguments about inheritance vs. user profiles. I've seen some posts in this forum where the examples even used some of the same model scenarios that I'm working with. Yet still...I need so

Re: Efficient counting...

2008-05-28 Thread radioflyer
On May 27, 7:45 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Wed, May 28, 2008 at 2:38 AM, radioflyer <[EMAIL PROTECTED]> wrote: > > > Which is the most efficient, 'proper' way to get a count on a query > > set? > > &

Efficient counting...

2008-05-27 Thread radioflyer
Which is the most efficient, 'proper' way to get a count on a query set? t_results = Track.objects.filter(query).order_by('title') count = t_results.count() # and pass 'count' to the template. or, in the template, Your search returned {{t_results|length}} track{{t_results| pluralize}}. Thanks

Best way to handle exceptions in Model pre-save...

2008-04-25 Thread radioflyer
Hello group, Below is code for manual pre-save integrity check. I think what I want is for the Validation Error (or an Integrity Error if I go that way) to end up in forms.errors. >From the form, I was doing: return HttpResponseRedirect(reverse(student, args=[s.id])) when I had a validation err

Re: 'message_set' causes ProgrammingError while handling Exception

2008-04-21 Thread radioflyer
Thanks again dallas and kenneth, Kenneth's comment about the clean process sent me back to the docs. I was using form.cleaned_data to do my own integrity checking, but I didn't realize what was truly available from the clean methods. Handling the validation with custom form methods does seem lik

Re: 'message_set' causes ProgrammingError while handling Exception

2008-04-20 Thread radioflyer
ays to do it. Dan J. On Apr 20, 9:00 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 21-Apr-08, at 12:50 AM, radioflyer wrote: > > > > > > > Hello, > > I need some help with the code after the IntegrityError exception. > > > > > s

'message_set' causes ProgrammingError while handling Exception

2008-04-20 Thread radioflyer
Hello, I need some help with the code after the IntegrityError exception. s = Student.objects.get(pk=student_id) if request.method == 'POST': form = ChangeForm(request.POST) if form.is_valid(): try: form.save() request.user.message_set.create(message="Your reques

Choices from table vs. Foreign Key relationship.

2007-12-17 Thread radioflyer
So the recommendation seems to be when your selection choices are not static you should go ahead and use a Foreign Key relationship. You get the automatic loading of the table into a select widget etc. But there's this issue of the cascade on delete. I have a Student model with a Foreign Key rel

Re: Check if in query set...

2007-12-09 Thread radioflyer
not s's guardian > > On Dec 9, 2007 6:11 PM, radioflyer <[EMAIL PROTECTED]> wrote: > > > > > I have a m2m relationship between users (guardians) and students. > > > I want to check if the currently logged in user has permission to edit > > a part

Re: Checking if in query set...

2007-12-09 Thread radioflyer
On Dec 9, 9:43 pm, radioflyer <[EMAIL PROTECTED]> wrote: > On Dec 9, 8:52 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > > > > > On Dec 9, 2007 5:06 PM, radioflyer <[EMAIL PROTECTED]> wrote: > > > > parents = students.parents.all() &

Re: Checking if in query set...

2007-12-09 Thread radioflyer
On Dec 9, 8:52 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On Dec 9, 2007 5:06 PM, radioflyer <[EMAIL PROTECTED]> wrote: > > > > > parents = students.parents.all() > > > And then check if logged in user.id matches against any of the paren

Check if in query set...

2007-12-09 Thread radioflyer
I have a m2m relationship between users (guardians) and students. I want to check if the currently logged in user has permission to edit a particular student. s = Student.objects.get(pk=student_id) parents = s.parents.all() And then check if logged in user.id matches against any of the parent i

Checking if in query set...

2007-12-09 Thread radioflyer
I have a m2m relationship between users (guardians) and students. I want to check if the currently logged in user has permission to edit a particular student. parents = students.parents.all() And then check if logged in user.id matches against any of the parent ids. Is there a query set method

Re: Help with design choice...

2007-11-18 Thread radioflyer
d > > On Nov 18, 5:47 pm, radioflyer <[EMAIL PROTECTED]> wrote: > > > Hello, > > > New Django user. > > > I'm building an application to help manage departure scenarios for > > elementary school students. One feature allows parents to login and

Help with design choice...

2007-11-18 Thread radioflyer
Hello, New Django user. I'm building an application to help manage departure scenarios for elementary school students. One feature allows parents to login and and make changes to their children's departure routine. ie. Instead of "Get on your normal bus," they could change it to "Go to music les

Adding image from model to change form...

2007-01-27 Thread radioflyer
Hello, I've used this advice: http://groups.google.com/group/django-users/browse_thread/thread/ bb7f406bffd697f5/76f738315a6947eb?lnk=gst&q=admin +thumbs&rnum=1#76f738315a6947eb to add a thumbnail to the model's list page in admin. I would like to also be able to display the thumb on the change

Re: Another print_r() to {% debug %} question...

2006-12-19 Thread radioflyer
Right on Aidas! That's what I needed to get me thinking straight. Thanks, Dan J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.

Another print_r() to {% debug %} question...

2006-12-18 Thread radioflyer
...I'm new to Python and still thinking like a PHP user I'm afraid... I've found a number of posts about dumping debug info to a template, but I'm still a little confused. Maybe I don't understand the nature of the 'context' returned from my view. If I have this view: def album(request, album_i