Seite 1 von 1
[Django]Kalender
Verfasst: Mittwoch 15. Juni 2011, 19:50
von SancezZ
Ich sitze wiedermal an einem Problem mit der GoogleAppEngine für Django
Ich will mir einen Kalender erstellen und hab auch schon
reines Django Tutorials gefunden.
Nun wollte ichs halt für den Appstore von Google umschreiben^^
Eigentlich nicht ganz so schwer
Nun hänge ich aber an einem Problem
AusgangsCode
Code: Alles auswählen
#models.py
class Entry(models.Model):
date = models.DateField(blank=True)
. . .
#views.py
. . .
entries = Entry.objects.filter(date__year=y, date__month=n+1)
. . .
Aktuell Umgeschriebener Code
Code: Alles auswählen
#models.py
class Entry(db.Model):
date = db.DateProperty()
. . .
#views.py
entries = Entry.all().filter(???)
Nun stellt sich mir die Frage wie kann ich dort meine Filterfunktion ansetzten?
Oder vielleicht gibs eine einfache Variante dies anderes zu händeln die sich mir noch verschließt^^
Bitte um hilfe
mfg SancezZ
Re: [Django]Kalender
Verfasst: Sonntag 19. Juni 2011, 20:27
von SancezZ
Ich bin gerade auf eine Fehlermeldung gestoßen mit der ich kaum was anfangen kann
Code: Alles auswählen
Environment:
Request Method: GET
Request URL: http://localhost:8081/day/2011/6/23/
Django Version: 1.3
Python Version: 2.5.4
Installed Applications:
['django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'djangotoolbox',
'autoload',
'dbindexer',
'cal',
'djangoappengine']
Installed Middleware:
('autoload.middleware.AutoloadMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Traceback:
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\core\handlers\base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\contrib\auth\decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\cal\views.py" in day
137. date__month=month, date__day=day, creator=request.user))
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\forms\models.py" in __init__
415. super(BaseModelFormSet, self).__init__(**defaults)
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\forms\formsets.py" in __init__
47. self._construct_forms()
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\forms\formsets.py" in _construct_forms
107. for i in xrange(self.total_form_count()):
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\forms\formsets.py" in total_form_count
83. initial_forms = self.initial_form_count()
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\forms\models.py" in initial_form_count
420. return len(self.get_queryset())
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\db\models\query.py" in __len__
82. self._result_cache = list(self.iterator())
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\django\db\models\query.py" in iterator
275. for row in compiler.results_iter():
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\djangotoolbox\db\basecompiler.py" in results_iter
219. for entity in self.build_query(fields).fetch(low_mark, high_mark):
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\djangoappengine\db\compiler.py" in fetch
92. query = self._build_query()
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\djangoappengine\db\compiler.py" in _func
59. return func(*args, **kwargs)
File "C:\Dokumente und Einstellungen\Besitzer\Desktop\django-testapp\djangoappengine\db\compiler.py" in _build_query
311. query.Order(*self.gae_ordering)
File "D:\Programme\Google\google_appengine\google\appengine\api\datastore.py" in Order
1256. (orderings[0][0], self.__inequality_prop))
Exception Type: DatabaseError at /day/2011/6/23/
Exception Value: First ordering property must be the same as inequality filter property, if specified for this query; received __key__, expected date
Vlt kann mir ja jemand helfen
danke
------------------------------
edit:
Immer kurz nachdem ich was poste löst sich das Problem sozusagen von selbst -.-