Wednesday, June 30, 2010

using django for google appengine, noob to both.

Hi, I'm using django on google appengine using this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

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 django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment