-
-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
I have a ListPostView component which list my posts.
class ListPostView(UnicornView):
posts = []
def mount(self):
self.posts = list(Post.objects.all().order_by('-created_at'))I have another component which is a form to create a new post.
I would like after saving a new post to refresh my ListPostView to display my new post.
class CreatePostView(UnicornView):
content = ""
def save(self):
if self.content:
post = Post.objects.create(content=self.content)
self.content = ""
# refresh ListPostView so it can show my new post.Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels