Closed psigourney closed 7 years ago
Even tried hardcoding a value to the StreamItem create, but the value in the store is 'None'. Is there another function which creates StreamItem records?
item = StreamItem.create(
owner=user,
file=upload,
URL=image_url,
name=name,
stream=stream,
latitude="hello",
longitude=lng)
of course. There's a helper function "create" in Ndbclasses.py
So where is this function called from?
@ classmethod
def create(cls, **kwargs):
# gather arguments
required_keys = ["name", "owner", "URL", "stream"]
for key in required_keys:
if "name" not in kwargs.keys():
raise TypeError('Missing required key "{}"'.format(key))
name = kwargs['name']
owner = kwargs['owner']
url = kwargs['URL']
stream = kwargs['stream']
blob = kwargs['file'] if 'file' in kwargs.keys() else None
blobkey = blob.key() if blob is not None else None
# create and return stream
item = StreamItem(
owner=owner.key,
blobKey=blobkey,
URL=url,
name=name,
stream=stream.key)
item.put()
return item
ohhhhh.... Service_UploadFile.py is calling this function.
Okay.... I get it now. Now it's working.
Cool!
Latitude and Longitude values are printing correctly from Service_UploadFile.py, but 'None' is being stored on the StreamItem entity.