Anyone have a quick perspective on the pros/cons of handling tags like
this:
Option 1:
db.define_table('item',Field('tags','list:string'))
Option 2:
db.define_table('tag')
db.define_table('item',Field('tags','list:reference tag'))
Options 3:
db.define_table('item')
db.define_table('tag')
On Mon, Oct 10, 2011 at 9:36 PM, pbreit pbreitenb...@gmail.com wrote:
Option 1:
db.define_table('item',Field('tags','list:string'))
I am using the Option 1.
for me it is better because I end with pure Python list, which I can run
map, reduce, filter etc...
also contains and belongs are
Clarifying:
Option 1:
db.define_table('item',Field('tags','list:string'))
*Pro*:
Easy search:
tag = request.args(0)
results = db(db.item.tags.contains(tag)).select()
*Con*:
build a tag cloud
records = db(db.item.id0).select(db.item.tags)
alltags = [] # loop thought records to populate the
3 matches
Mail list logo