Re: User Profiles "user.get_profile()" returns 'matching query does not exist.'

2014-03-28 Thread Brian Sanchez
try: except: it worked thank you!! On Saturday, September 20, 2008 9:14:42 PM UTC-4, Paddy Joy wrote: > > The error message is telling you that the user has no profile > (Specifically there is no record in the table schedule.profile related > to the user). > > Your app needs to take care of c

Re: loop user.get_profile displays none in a template

2012-10-19 Thread smcoll
t; > how can I get each key and value by loop or another method? I wanna > display all infomations about a model instance > > 在 2012年10月19日星期五UTC+8上午11时33分48秒,Matt Schinckel写道: >> >> user.get_profile() returns a model instance, not a dict. Model instances >&g

Re: loop user.get_profile displays none in a template

2012-10-18 Thread David Lee
how can I get each key and value by loop or another method? I wanna display all infomations about a model instance 在 2012年10月19日星期五UTC+8上午11时33分48秒,Matt Schinckel写道: > > user.get_profile() returns a model instance, not a dict. Model instances > have no .items() method. > > M

Re: loop user.get_profile displays none in a template

2012-10-18 Thread Matt Schinckel
user.get_profile() returns a model instance, not a dict. Model instances have no .items() method. Matt. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/dj

loop user.get_profile displays none in a template

2012-10-18 Thread David Lee
Hi,pal ! in a template, {{ user.get_profile.user }} {{ user.get_profile.birthday }} {{ user.get_profile.name }} {% for key,value in user.get_profile.items %}{{ value }}{% endfor %} the last line doesnt work and displays none . Any guidance would be greatly appreciated. models.py: *class UserP

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread salai...@gmail.com
Hello ! You must import the user model before using it ! Thks Le lundi 18 juin 2012 14:29:55 UTC, Kurtis a écrit : > > Give this a shot: > > user = User.objects.create_user(request.POST['apelido'], > request.POST['email'], request.POST['pwd'

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread upmauro
Solve, thank you ! On Monday, June 18, 2012 11:29:55 AM UTC-3, Kurtis wrote: > > Give this a shot: > > user = User.objects.create_user(request.POST['apelido'], > request.POST['email'], request.POST['pwd']) > user.save() > profile = user.get_

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread Kurtis Mullins
Give this a shot: user = User.objects.create_user(request.POST['apelido'], request.POST['email'], request.POST['pwd']) user.save() profile = user.get_profile() profile.apelido = request.POST['apelido'] profile.save() Also, I recommend using Forms (and

Problem using User.get_profile() in DJANGO

2012-06-18 Thread upmauro
mail'], request.POST['pwd']) user.get_profile().apelido = request.POST['apelido'] * * *Error:* * * Exception Value: Usuario matching query does not exist *Line:*. user.get_profile().apelido = request.POST['apelido'] -- You received this message because you are su

Re: User.get_profile() not working

2010-09-29 Thread Daniel Roseman
On Sep 29, 4:34 am, Skylar Saveland wrote: > Using *args and **kwargs might work > > then maybe > > self.website = kwargs.get('website', 'default.com') But the point is, there's no need to do that. That is built-in functionality: both the setting of 'website' via keyword, and the default, which c

Re: User.get_profile() not working

2010-09-29 Thread adj7388
Still learning. Always learning. I guess I learn best when I break stuff and do dumb things. Thanks to all who replied for the great advice and tips. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: User.get_profile() not working

2010-09-28 Thread Skylar Saveland
Using *args and **kwargs might work then maybe self.website = kwargs.get('website', 'default.com') On Sep 28, 1:45 pm, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in several > places in documentation)

Re: User.get_profile() not working

2010-09-28 Thread Skylar Saveland
Overriding __init__ might be a little shady, but you probably can get away with it if you use *args and **kwargs On Sep 28, 1:45 pm, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in several > places in do

Re: User.get_profile() not working

2010-09-28 Thread Daniel Roseman
On Sep 28, 6:45 pm, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in several > places in documentation). Here's what I have --- a simple example of > storing the user's website in a profile > > #In myapp/m

Re: User.get_profile() not working

2010-09-28 Thread adj7388
Good grief. After spending hours trying to figure out what was wrong, I immediately found the problem after making this post. Here's the solution: I had overridden UserProfile.__init__() like this: class UserProfile(models.Model): def __init__(self, website='http://www.default.com'): while i

Re: User.get_profile() not working

2010-09-28 Thread Ale
On Tue, Sep 28, 2010 at 2:45 PM, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in several > places in documentation). Here's what I have --- a simple example of > storing the user's website in a profile >

User.get_profile() not working

2010-09-28 Thread adj7388
Django newbie issue. Just trying to understand. I'm setting up a simple UserProfile class to link to User (as described in several places in documentation). Here's what I have --- a simple example of storing the user's website in a profile #In myapp/models.py class UserProfile(models.Model): d

Re: Model inheritance vs. User.get_profile()

2009-03-18 Thread Johan
HaHa (After some reading) Silly me my way is the get_profile route :) On Mar 18, 4:58 pm, Johan wrote: > Hiya , > >   I don't know the get_profile route (Am going to read up on that > now :)). But here is an example of what I'm using : > >   class Student(models.Model): >     base = mod

Re: Model inheritance vs. User.get_profile()

2009-03-18 Thread Johan
Hiya , I don't know the get_profile route (Am going to read up on that now :)). But here is an example of what I'm using : class Student(models.Model): base = models.OneToOneField(User, primary_key=True) first_name = models.CharField(max_length=100) last_name = models.CharField(m

Re: Model inheritance vs. User.get_profile()

2009-03-18 Thread ntoll
Thanks for the information and link Malcolm. To cut a long story short, I'll just use get_profile(). On Mar 17, 11:32 pm, Malcolm Tredinnick wrote: > On Tue, 2009-03-17 at 09:49 -0700,ntollwrote: > > Guys, > > > Asking for advice here. > > > What is the best way to extend the User class in > > d

Re: Model inheritance vs. User.get_profile()

2009-03-18 Thread ntoll
Dougal, Thanks for the heads up... looks like I'l user get_profile if only for the the next guy who comes along... :-) Nicholas. On Mar 17, 11:01 pm, Dougal Matthews wrote: > get_profile is newer than model inheritance I believe. > Working with profile is how everybody seems to be doing it, so

Re: Model inheritance vs. User.get_profile()

2009-03-17 Thread Malcolm Tredinnick
On Tue, 2009-03-17 at 09:49 -0700, ntoll wrote: > Guys, > > Asking for advice here. > > What is the best way to extend the User class in > django.contrib.auth.models...? > > I could either inherit the class for my own model and add fields / > methods or use get_profile(). Now, whilst I realise

Re: Model inheritance vs. User.get_profile()

2009-03-17 Thread Dougal Matthews
get_profile is newer than model inheritance I believe. Working with profile is how everybody seems to be doing it, so follow the trend and it'll make every bodies lives easier ;) If you really want to read more about it, there is loads of chatter on the subject so to avoid reppetition; http://www.

Model inheritance vs. User.get_profile()

2009-03-17 Thread ntoll
Guys, Asking for advice here. What is the best way to extend the User class in django.contrib.auth.models...? I could either inherit the class for my own model and add fields / methods or use get_profile(). Now, whilst I realise that get_profile() is the official advice it seems a tad out-of-da

Re: User Profiles "user.get_profile()" returns 'matching query does not exist.'

2008-09-20 Thread mclovin
That fixed it! I thought it automatically created and attached one which is why i was so confused. On Sep 20, 8:14 pm, Paddy Joy <[EMAIL PROTECTED]> wrote: > The error message is telling you that the user has no profile > (Specifically there is no record in the table schedule.profile related > to

Re: User Profiles "user.get_profile()" returns 'matching query does not exist.'

2008-09-20 Thread Paddy Joy
The error message is telling you that the user has no profile (Specifically there is no record in the table schedule.profile related to the user). Your app needs to take care of creating the user profile, even if it going to be empty. What I have done in my case is I force the user to create a pr

User Profiles "user.get_profile()" returns 'matching query does not exist.'

2008-09-20 Thread mclovin
I have spent about 2 hours on this so far, but havent been able to get it right, my model is: (located in schedule/models.py, stripped down to just the profile) from django.contrib.auth.models import User class profile(models.Model): user = models.ForeignKey(User, unique=True) aim = mode

Re: error when using User.get_profile()

2008-09-08 Thread Sven Richter
But when i want to retrieve a user profile i get a weird error: > > user = get_object_or_404(User, id=9) > user.get_profile() > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packa

Re: error when using User.get_profile()

2008-09-08 Thread Karen Tracey
user = get_object_or_404(User, id=9) > user.get_profile() > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/django/contrib/auth/ > models.py", line 293, in get_profile >self._profile_cache = > model._default

Re: error when using User.get_profile()

2008-09-08 Thread sveri
; > far > > for adding new users. > > > But when i want to retrieve a user profile i get a weird error: > > > user = get_object_or_404(User, id=9) > > user.get_profile() > > > Traceback (most recent call last): > >  File "", line 1, in &

Re: error when using User.get_profile()

2008-09-08 Thread Matthias Kestenholz
user = get_object_or_404(User, id=9) > user.get_profile() > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/django/contrib/auth/ > models.py", line 293, in get_profile >self._profile_cache = > model._

error when using User.get_profile()

2008-09-08 Thread sveri
Hi, i am using Django 1.0 and try to extent the usermodel, which works so far for adding new users. But when i want to retrieve a user profile i get a weird error: user = get_object_or_404(User, id=9) user.get_profile() Traceback (most recent call last): File "", line 1, in

Re: User.get_profile() (was: Re: Reusable models?)

2008-05-21 Thread James Bennett
On Wed, May 21, 2008 at 2:00 PM, Jeremy Bornstein <[EMAIL PROTECTED]> wrote: > This brings up something I don't quite get: Django provides > user.get_profile(), but the ORM makes it just as easy to say > user.userprofile (assuming your profile model is called > "

Re: User.get_profile() (was: Re: Reusable models?)

2008-05-21 Thread Marty Alchin
On Wed, May 21, 2008 at 3:00 PM, Jeremy Bornstein <[EMAIL PROTECTED]> wrote: > (assuming your profile model is called "UserProfile") I think you just answered your own question. Consider a third-party app that might be used to manage user profiles, but leaves the actual implementation of that pro

User.get_profile() (was: Re: Reusable models?)

2008-05-21 Thread Jeremy Bornstein
r > profile" for a given site. You could emulate that for your own models > quite easily. This brings up something I don't quite get: Django provides user.get_profile(), but the ORM makes it just as easy to say user.userprofile (assuming your profile model is called "UserProf

Re: User.get_profile() behaviour questions

2008-02-12 Thread Roboto
lol sorry.. yes you're right malcom. it's user.get_profile without parenthesis in templates =P Thanks for your assistance On Feb 12, 9:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-02-12 at 06:06 -0800, Roboto wrote: > > Hey all, > > >

Re: User.get_profile() behaviour questions

2008-02-12 Thread Malcolm Tredinnick
On Tue, 2008-02-12 at 06:06 -0800, Roboto wrote: > Hey all, > > I guess I'm lazy with sql queries, so I've got a quick question. I > just pulled a set of results from a table that foreign_keys the User > table. > > But at the same time I'd like to access the get_profile data for each > one of

User.get_profile() behaviour questions

2008-02-12 Thread Roboto
Hey all, I guess I'm lazy with sql queries, so I've got a quick question. I just pulled a set of results from a table that foreign_keys the User table. But at the same time I'd like to access the get_profile data for each one of the users. I know that if you do: print e.blog #hits the database

Re: user.get_profile() attribute error

2008-01-12 Thread Alex Koshelev
he wrong Model name. > useraccount instead of userprofile. > > Whoops. Thanks! > > Though the documentation might be wrong, in that DoesNotExist doesn't > seem to be a real exception. ObejctDoesNotExist, as defined in django/ > core/exceptions.py, is the correct exception when a pro

Re: user.get_profile() attribute error

2008-01-12 Thread [EMAIL PROTECTED]
rrect exception when a profile doesn't exist if user.get_profile() is called. Ivan On Jan 12, 3:24 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Do you create a profile model and set right value in settings.py > file?http://www.djangoproject.com/documentation/authentication/

Re: user.get_profile() attribute error

2008-01-12 Thread Alex Koshelev
янв, 01:32, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to catch any exceptions from user.get_profile() during > account creation in order to create the profile > > I create the user, authenticate them, log them in, and then try to > get_profile

user.get_profile() attribute error

2008-01-12 Thread [EMAIL PROTECTED]
I'm trying to catch any exceptions from user.get_profile() during account creation in order to create the profile I create the user, authenticate them, log them in, and then try to get_profile. To start out, the user name is the email and I'm setting the password to a random strin

Re: user.get_profile()

2007-03-01 Thread James Bennett
On 2/28/07, MattW <[EMAIL PROTECTED]> wrote: > ValueError at /accounts/profile/ > too many values to unpack You've probably put a full Python path into the value of AUTH_PROFILE_MODULE, when it expects 'appname.modelname' instead. -- "Bureaucrat Conrad, you are technically correct -- the best k

Re: user.get_profile()

2007-02-28 Thread Lawrence Oluyede
On 2/28/07, MattW <[EMAIL PROTECTED]> wrote: > > Dear All, > > I have a view method that looks like this: I think you need the SVN version of Django, as they suggested to you in the other thread about user authentication -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to

user.get_profile()

2007-02-28 Thread MattW
Dear All, I have a view method that looks like this: @login_required def viewprofile(request): uname = request.user.username profile = request.user.get_profile() return HttpResponse(uname) I have a models.py file that includes: class MySiteProfile(models.Model): user = models.F