Thanks Waldemar, That explains it and I fell back on using 'native'
GAE. I'm still learning what to use from Django and when to use
'native' GAE.

A follow up question I have is how to add a nickname to the user
model. I've spent a lot of time searching/thinking/tinkering how to do
this and keep ending up with problems. What I really want to
accomplish is to have a nickname for a user available in all views/
templates. The user case is to enable folks to change their nickname
at will without changing their username/login creds(also it will be
possible to have multiple users with the same nickname which is fairly
important for my user base).

I have created a UserProfile, with back reference to user model and
can successfully use my_user = user.get_profile() and then access the
nickname via my_user.nickname. Works ok for use in views.

However, I want to be able to show the nickname when using queries w/
collections in templates as one can use request.user.username in views
and user.username in templates(i.e. user.nickname). I've looked at use
a custom context processor for this but wondering if that is the best/
most scalable/preferred method for doing so.

Ideally it would work such as:

    {% for user in users %}
          {{user.nickname}} {{user.email}} ***user.email,
user.username, etc. already work via django.auth
    {% endfor %}

when using a query such as users = user.connections.filter('user =',
myself).

Any guidance, suggestions, recommendations is appreciated.

On Jan 15, 8:07 am, Waldemar Kornewald <[email protected]> wrote:
> Hi Dave,
>
> On Jan 14, 6:34 pm, Dave <[email protected]> wrote:
>
>
>
> > I'm trying like crazy to use Django's model.object manager but
> > struggling to find good documentation. Anybody have good links for
> > this.
>
> > Specifically what is killing me right now is understanding the
> > exceptions. I currently have:
>
> >   69.  from models import ConfirmUserRegistration
> >   70.
> >   71. try:
> >   72. ConfirmUserRegistration.objects.get(key=key)
>
> >   73. except ConfirmUserRegistration.DoesNotExist: ...
>
> >   74. return username
> >   75. raise forms.ValidationError(_("A user with that username already
> > exists."))
> >   76.
>
> > and I get an exception on line 73 of 'type object
> > 'ConfirmUserRegistration' has no attribute 'DoesNotExist'. I've
> > searched as much django docs & google to figure out the problem but at
> > a loss. The Django docs I've reviewed on Django site show the use of
> > DoesNotExist: but for some reason it's not working for me.
>
> > Also I am using django authentication and it's successfully using this
> > structure, including the DoesNotExist:, in  the UserCreationForm clean
> > routine. I've tried to set everything up the same way but  must have
> > missed something.
>
> Django's Model class isn't supported and can't be fully supported on
> App Engine. You have to use Google's Model class. The Django code you
> see isn't really executed, but replaced at runtime with versions that
> use db.Model.
>
> http://code.google.com/appengine/docs/datastore/modelclass.html
>
> Bye,
> Waldemar Kornewald
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to