I have two inherited models with multiple tables:
class Post(models.Model):
title = models.CharField(max_length=100, blank=True, null=True)
text = models.TextField(blank=True, null=True)
location = models.PointField()
...
class BlogPost(Post):
blog = models.ForeignKey(Blog)
Similarly, the form class for BlogPost also inherits from the PostForm class:
class PostForm(MapModelForm):
...
class Meta:
model = Post
def clean(self):
...
class BlogPostForm(PostForm):
class Meta:
model = BlogPost
I used processing / updating for both models in two non-class views. To make things dry, I decided to try class-based Django. But due to the lack of examples and the unfriendliness of users of related documents and various approaches, I am confused.
The idea is to have class-based form submissions for the model Postand inherit them for BlogPost. How should I adapt presentation classes?
PostCreate PostUpdate? , .
FormView / ? , , .
( /), mixin ?