-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass request.FILES to form #189
base: master
Are you sure you want to change the base?
pass request.FILES to form #189
Conversation
build currently failing due to 3.6 removal from ubuntu 22.04 |
Thanks, Python 3.6 removal is taken care in #191. |
Hopefully that's close to what you had in mind! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, thanks a lot! Just some minor things to fix, and also rebase on latest master.
tests/custom_comments/forms.py
Outdated
@@ -1,5 +1,12 @@ | |||
from django import forms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required for FileField, changed to explicit import of FileField
tests/custom_comments/models.py
Outdated
@@ -1,5 +1,7 @@ | |||
from django.db import models | |||
|
|||
from django_comments.models import Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs suggest using from django_comments.abstracts import CommentAbstractModel
to create a custom comment model.
tests/custom_comments/models.py
Outdated
@@ -1,5 +1,7 @@ | |||
from django.db import models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required for FileField, changed to explicit import of FileField
@@ -1,6 +1,10 @@ | |||
from django.conf import settings | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chop this new line.
|
||
import django_comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could import get_model
on the line below instead.
COMMENTS_APP='custom_comments', | ||
) | ||
def testPostCommentWithFile(self): | ||
a = Article.objects.get(pk=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would rather create a new separate test class at the bottom of the file.
… for use in custom comment app tests
9d37255
to
1866bdf
Compare
Think I've fixed all the required changes. |
Passing request.FILES to the CommentForm in post_comment view.
Allows for the comment form and comment model to be extended with file fields without having to override the post_comment view.
#190