Stuart Grimshaw
Stuart Grimshaw

Reputation: 1571

Implementing tags on Google App Engine

I've read the similar question on adding tags to a Django Blog model, where it mentions maintaining tags on the article as a StringList and a separate object to keep a count of these objects, which is good because I'd basically come up with the same idea myself, however I'm struggling to work how how to maintain the count.

I'm overriding the put() method of the main object, but how do I check to see if the tags have changed compared to the object currently stored? Is there any way to cheaply check the existing data without fetching a 2nd copy of the object?

One way to handle it is to store each object in memcache and only fetch the ones it doesn't find in there, but for a busy site, you're still going to be hitting the datastore quite often.

Upvotes: 7

Views: 1523

Answers (1)

Adam Crossland
Adam Crossland

Reputation: 14213

Check out taggable-mixin. It's a pretty straightforward way to add tags to any AppEngine model class as a mixin.

Upvotes: 6

Related Questions