0
Это как мой хранилищу выглядит следующим образом:AttributeError: объект типа «HashStore» не имеет атрибута «хэштег» при использовании хранилища в AppEngine
class HashStore(ndb.Model):
"""Models an individual HashStore entry with hastag, tile, and date."""
author = ndb.UserProperty()
title = ndb.StringProperty(indexed=False)
hastag = ndb.StringProperty(indexed=False, default="")
viewDate = ndb.DateTimeProperty(auto_now_add=True)
Это как мой обработчик запроса выглядит следующим образом:
class Add(webapp2.RequestHandler):
def post(self):
NoteTitle = self.request.get("title")
NoteHashtags = self.request.get("hashtags")
HashEntry=HashStore(author=users.get_current_user(),hashtag=NoteHashtags,title=NoteTitle)
HashEntry.put()
Когда я пытаюсь добавить данные в DATASTORE я получаю эту ошибку:
type object 'HashStore' has no attribute 'hashtag'
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~keep-tabs-on/1.371681382109791887/KeepTabsOn.py", line 55, in post
HashEntry=HashStore(author=users.get_current_user(),hashtag=NoteHashtags,title=NoteTitle)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 2745, in __init__
self._set_attributes(kwds)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/model.py", line 2788, in _set_attributes
prop = getattr(cls, name) # Raises AttributeError for unknown properties.
AttributeError: type object 'HashStore' has no attribute 'hashtag'
Может вы, ребята, указать меня в правильном направлении или чего я здесь не вижу.