9.2.4 Creating Startup Objects in a View with StartupForm

It should come as no surprise that the views to interact with StartupForm and NewsLinkForm to create new objects will be almost identical to TagCreate or PostCreate.

For StartupCreate, as you can see in Example 9.28, the only differences are these:

1. The value of the class attribute template_name

2. The value of the class attribute form_class

Example 9.28: Project Code

organizer/views.py in 59bb59cf69

 5   from .forms import StartupForm, TagForm  .       ...  9   class StartupCreate(View): 10       form_class = StartupForm 11       template_name = 'organizer/startup_form.html' 12 13       def get(self, request): 14           return render( 15               request, ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.