BaseModel extends db.Model :)

http://stackoverflow.com/questions/1720157/diference-between-appengine-django-basemodel-and-db-model


On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <[email protected]> wrote:

> Thank you for your reply.  I gave it a try, and it didn't seem to
> work.  The helper project (according to the introductory article) has
> me using their "BaseModel", which I think is supposed to revert me
> back to using Django code.  However there seems to be very little
> written beyond that article, although it is a good one.  I went back
> to the site, they have a google group specifically for this set up,
> I'm going to post over to that group now.  Thanks again.
>
> Joe
>
> On Jun 30, 3:12 pm, Felippe Bueno <[email protected]> wrote:
> > I think (THINK) you problem is with the db.Model
> >
> > Take a look athttp://
> code.google.com/appengine/docs/python/datastore/queryclass.htm...
> >
> > <http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> .>You
> > will see that db.Model don't have the filter method, db.Query have it.
> > You need to do some think like:
> > a = XItUser.all()
> > a.filter('xit_nickname =', 'awesome')
> >
> > I'm not sure if there is another way....
> >
> >
> >
> > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <[email protected]>
> wrote:
> > > Hi, I'm using django on google appengine using this:
> > >http://code.google.com/appengine/articles/appengine_helper_for_django.
> ..
> >
> > > So I have my models, and I can load my pages and templates, and
> > > started to do some rudimentary object creates and gets inside the
> > > shell (python manage.py shell) and my views to get a feel for the
> > > API.  Immediately Im coming across errors, which seem weird since
> > > their so simple, and right out of the sample docs. (http://
> > > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > > I'm guessing i have setup or import problem?  Or I'm missing something
> > > major with the appengine way of things, but I am under the impression
> > > after the setup it should run the same.  Either way maybe someone can
> > > tell me better.
> >
> > > Thanks,
> > > j
> >
> > > >>> b = XItUser(xit_nickname="awesome")
> > > >>> b.save()
> > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > > >>> b
> > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > > Traceback (most recent call last):
> > >  File "<console>", line 1, in <module>
> > >  File ".../models.py", line 37, in __getattr__
> > >    return getattr(self.owner, name)
> > > AttributeError: type object 'XItUser' has no attribute 'filter'
> > > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > > Traceback (most recent call last):
> > >  File "<console>", line 1, in <module>
> > > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > > Traceback (most recent call last):
> > >  File "<console>", line 1, in <module>
> > >  File ".../models.py", line 37, in __getattr__
> > >    return getattr(self.owner, name)
> > > AttributeError: type object 'XItUser' has no attribute 'filter'
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<django-users%[email protected]>
> <django-users%2bunsubscr...@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en.

Reply via email to