O'Reilly logo

Django 1.0 Web Site Development by Ayman Hourieh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the bookmark submission form

Now that we can store the tag data along with other bookmark information, we are ready to create a form for submitting bookmarks to the database. This form will let users specify the bookmark's URL, title, and tags. The process of creating this form is very similar to that of the registration form we created in Chapter 4. In fact, the method explained here can be used to create any HTML form that saves information into the database.

The first step in building our form is defining a class for it. So open the bookmarks/forms.py file and add the following class to it:

class BookmarkSaveForm(forms.Form):   url = forms.URLField(     label=u'URL',     widget=forms.TextInput(attrs={'size': 64})   )   title = forms.CharField( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required