Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 648
Stuart Grimshaw Avatar asked Jan 31 '10 00:01

Stuart Grimshaw


1 Answers

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

like image 81
Adam Crossland Avatar answered Oct 20 '22 00:10

Adam Crossland