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
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
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
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
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
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'
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_
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
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
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
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
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)
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
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
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
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
>
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
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
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
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
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
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
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.
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
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
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
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
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
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
; > 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
&
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._
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
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
> "
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
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
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,
>
> >
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
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
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
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/
янв, 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
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
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
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
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
45 matches
Mail list logo