Hi.
I need to save in my model a list of objects from a certain class on the datastore.
Is there any simple way to archive this with ListProperty and custom property's without going into pickled/simplejson blob data?
I just want something like this:
class Test:
pass
class model(db.Model):
list = db.ListProperty(Test)
Loo...
Ok so I have the same python code locally and in the gae cloud.
when I store an entity locally, the ListProperty field of set element type datetime.datetime looks like so in the Datastore Viewer:
2009-01-01 00:00:00,2010-03-10 00:00:00
when I store same on the cloud, the viewer displays:
[datetime.datetime(2009, 1, 1, 0, 0), datetim...
I have a model which looks like this:
class test (db.Model) :
tagList = StringListProperty()
siteName = StringProperty()
I am storing tags in "tagList" and would like to run a query where I can get all test entities containing a particular tag in their tagList.
Is this possible?
...
I have model which looks like this:
class Example (db.Model) :
name = db.StringProperty()
tags = db.StringListProperty()
I first query for a tag to get the list of entities which have them:
results = Example.all().filter("tags =", tagSearch).fetch(100)
This gives me a list of entities containing the "tagSearch" in their "tags" li...
this is my model:
class Geo(db.Model):
entry = db.ListProperty(db.Key)
geo=Geo()
geo.entry.append(otherModel.key())
and the html is :
{% for i in geo.entry %}
<p><a href="{{ i.link }}">{{ i.title }}</a></p>
{% endfor%}
but it show nothing,
i think maybe should :
class Geo(db.Model):
entry = db.ListProperty(db.Mod...
like one forum has many topic ,
ths specific is : forum and topic has the same model :
class Geo(db.Model):
#self = db.SelfReferenceProperty()
title = db.StringProperty()
link = db.StringProperty()
updated = db.DateTimeProperty(auto_now =True)
author = db.ReferenceProperty(MyUser)
id = db.StringProperty()
e...
If I have an db.Model object such as:
class Foo(db.Model):
title = db.StringProperty()
bars = db.ListProperty(db.Key)
and I wanted to query the datastore for all of the Foo entities and sort that set by the Foo objects that have the most bars, how would I write the GQL?
I was hoping for something as simple as:
fooQuery = db....