Error binding parameter 1 - probably unsupported type.Request Method:
POST
Request URL: http://127.0.0.1:8000/save/
Exception Type: InterfaceError
Exception Value: Error binding parameter 1 - probably unsupported
type.
Exception Location: d:\Python26\lib\site-packages\django\db\backends
\sqlite3\base.py in execute, line 193
Python Executable: d:\Python26\python.exe


this is my views.py:
def bookmark_save_page(request):
  if request.method == 'POST':
    form = BookmarkSaveForm(request.POST)
    if form.is_valid():
# get_or_create()will ruturn an object and a boolean value
      link, dummy = Link.objects.get_or_create(url=form.cleaned_data
['url'])
      bookmark, created = Bookmark.objects.get_or_create(
        user=request.user,
        link=link
      )
      bookmark.title = form.cleaned_data['title']
      if not created:
        bookmark.tag_set.clear()
      tag_names = form.cleaned_data['tags'].split()
      for tag_name in tag_names:
        tag, dummy = Tag.objects.get_or_create(name=tag_name)
        bookmark.tag_set.add(tag)
      bookmark.save()
      return HttpResponseRedirect('/user/%s/' % request.user.username)
  else:
    form = BookmarkSaveForm()
  variables = RequestContext(request, {
    'form': form
  })
  return render_to_response('bookmark_save.html', variables)

this is my models.py:
class Bookmark(models.Model):
        title = models.CharField(max_length=200)
        user = models.ForeignKey(User)
        link = models.ForeignKey(Link)
        def __str__(self):
                return'%s,%s'%(self.user.username,self.link.url)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to