you can do:

def tag_record(table,id,tag):
    db_tag = table.db.plugin_wiki_tag
    db_link = table.db.plugin_wiki_link
    tag_name = re.compile('\s+').sub(' ',tag).strip()
    tag = db(db_tag.name==tag_name).select().first()
    if not tag:
        tag = db_tag.insert(name=tag_name, links=1)
    db_link.insert(tag=tag.id,table_name=table,record_id=id)

crud.create(table,record,onaccept=lambda id:
tag_record(table,id,'tag'))

On Apr 2, 6:27 pm, skwasha <sas...@umich.edu> wrote:
> Is there anyway to take advantage of the plugin-wiki tagging widget at
> object creation (i.e., assign tags to a record as part of it's
> submission)? Or do I just need to implement my own?
>
> TIA

Reply via email to