-
Notifications
You must be signed in to change notification settings - Fork 0
feat:add faq and quickguide #4
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
base: master
Are you sure you want to change the base?
Conversation
models/faq.py
Outdated
from formula_one.models.base import Model | ||
from formula_one.utils.upload_to import UploadTo | ||
|
||
class faq(models.Model): |
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.
follow proper naming convention with first character in upper case
models/faq.py
Outdated
) | ||
|
||
class Meta(object): | ||
verbose_name_plural='faqs' |
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.
Add a blank line at the end
models/quickguide.py
Outdated
from formula_one.models.base import Model | ||
from formula_one.utils.upload_to import UploadTo | ||
|
||
class quickguide(models.Model): |
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.
Same here
models/quickguide.py
Outdated
upload_to=UploadTo('helpcentre','quickguide'), | ||
blank=False, | ||
null=False, | ||
) |
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.
blank line at end
serializers/faq_serializer.py
Outdated
from rest_framework.serializers import ModelSerializer | ||
from helpcentre.models import faq | ||
|
||
class faq_serializer(ModelSerializer): |
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.
follow pascal case
serializers/quickguide_serializer.py
Outdated
from rest_framework.serializers import ModelSerializer | ||
from helpcentre.models import quickguide | ||
|
||
class quickguide_serializer(ModelSerializer): |
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.
https://peps.python.org/pep-0008/#class-names
name convention should be done according to this
views/faq_view.py
Outdated
Person=swapper.load_model('kernel','Person') | ||
Maintainer=swapper.load_model('kernel','Maintainer') | ||
|
||
class faq_view(ModelViewSet): |
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.
same for here
}, | ||
status=status.HTTP_403_FORBIDDEN, | ||
) | ||
|
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.
add a blank line at end
views/quickguide_view.py
Outdated
'Error':'You cannot perform this action' | ||
}, | ||
status=status.HTTP_403_FORBIDDEN, | ||
) |
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.
add blank line at end
views/quickguide_view.py
Outdated
Person=swapper.load_model('kernel','Person') | ||
Maintainer=swapper.load_model('kernel','Maintainer') | ||
|
||
class quickguide_view(ModelViewSet): |
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.
follow proper naming conventions, read previous codes and then do naming
No description provided.