File "C:\Python24\Scripts\bookmarker\bookmarker\controllers.py", line
84, in save_bookmark
description=kwargs["description"])
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\declarative.py",
line 93, in _wrapper
return fn(self, *args, **kwargs)
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\main.py",
line 1197, in __init__
self._create(id, **kw)
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\main.py",
line 1224, in _create
self._SO_finishCreate(id)
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\main.py",
line 1248, in _SO_finishCreate
id, names, values)
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\dbconnection.py",
line 764, in queryInsertID
return self._dbConnection._queryInsertID(
File
"C:\Python24\lib\site-packages\sqlobject-0.7.1dev_r1860-py2.4.egg\sqlobject\sqlite\sqliteconnection.py",
line 167, in _queryInsertID
c.execute(q)
IntegrityError: column bookmark_name is not unique
In think the bug must be in the 'bookmark' or 'save_bookmark', which
look like:
@expose(template="bookmarker.templates.form")
def bookmark(self, *args, **kwargs):
if args and args[0] == "add":
values=""
submit_action="/save_bookmark/"
if args and args[0] == "edit":
from sqlobject import SQLObjectNotFound
try:
b= Bookmarks.get(args[1])
default_options= []
for a in b.categories:
default_options.append(a.id)
values = {"bookmarkName" : b.bookmarkName,
"link" : b.link,
"description" : b.description,
"categories" : default_options}
except SQLObjectNotFound:
values=""
flash("That's not an valid Bookmark,do you want to add
one?")
submit_action="/save_bookmark/edit/%s" % args[1]
return dict(form=bookmark_form, values=values,
action=submit_action)
@expose()
@error_handler(bookmark)
@validate(form=bookmark_form)
def save_bookmark(self, *args, **kwargs):
try:
b=Bookmarks.get(args[1])
b.bookmarkName = kwargs["bookmarkName"]
b.link =kwargs["link"]
b.description = kwargs["description"]
Bookmarks.updateCategories(b,kwargs["categories"])
except:
b=Bookmarks(bookmarkName=kwargs["bookmarkName"],
link=kwargs["link"],
description=kwargs["description"])
for item in kwargs["categories"]:
b.addCategories(Categories.get(item))
raise redirect("/index")
Does anybody have an idea what's missing ?
Besides, the form validators do not work.
Regards,
Markus
--Mark Ramm
--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog
Could you send your model code? Perhaps the problem is there.
--Mark
On 12/6/06, emzett <m...@zmija.de> wrote:
>
> I have tried to follow the bookmarker example in chapter 5 of the
> Turbogearsbook. But
> now I get the following error message when trying to update on of the
> bookmarks:
>
> File "C:\Python24\Scripts\bookmarker\bookmarker\controllers.py", line
> 84, in save_bookmark
> description=kwargs["description"])
Snipped.
http://www.turbogearsbook.com/code
and see if there are any differences between the code you have and
that version.
--Mark Ramm
On 12/6/06, emzett <m...@zmija.de> wrote:
>
-Jeff
--
Jeff Hinrichs
Dundee Media & Technology, Inc
je...@dundeemt.com
402.320.0821
I'll look into the options tomorrow. Right now the site is just
static HTML, but I think I thought I saw a TG based web watcher with
RSS feed output, so that might be an easy option.
--Mark Ramm