Skip navigation

App Engine StringListProperty and merge join queries offer the ability to perform searches for a variety of purposes.


class AttributeTags(db.model):
	tags = db.StringListProperty()

Say for instance you would like to create a data object which needs dynamic properties that are easily searchable – for example real estate.

Tags could be such:


a = AttributeTags(tags=['000_3_bedroom', '001_2_bathroom', '002_1_garage'])
a.put()
b = AttributeTags(tags=['000_5_bedroom', '001_4_bathroom', '002_3_garage'])
b.put()
c = AttributeTags(tags=['000_4_bedroom', '001_3_bathroom', '002_3_garage'])
c.put()

SELECT __keys__ FROM AttributeTags WHERE tags >= '000_3' AND tags < '000_4'

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: