You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
944 B
41 lines
944 B
# -*- coding: utf-8 -*-
|
|
from django import forms
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from .models import Review, SiteReview
|
|
|
|
from captcha.fields import ReCaptchaField
|
|
|
|
|
|
class ReviewCreateForm(forms.ModelForm):
|
|
"""
|
|
Create Review form for creating review
|
|
|
|
"""
|
|
class Meta:
|
|
model = Review
|
|
fields = ('comment', 'rating')
|
|
|
|
|
|
class ReviewChangeForm(forms.ModelForm):
|
|
"""
|
|
Create Review form for changing review
|
|
|
|
"""
|
|
class Meta:
|
|
model = Review
|
|
fields = ('comment', 'rating', 'user')
|
|
|
|
|
|
class SiteReviewForm(forms.ModelForm):
|
|
"""
|
|
Форма для отзывов о сайте и предложений по улучшению
|
|
"""
|
|
captcha = ReCaptchaField(attrs={'theme': 'clean'})
|
|
|
|
class Meta:
|
|
model = SiteReview
|
|
exclude = ()
|
|
widgets = {
|
|
'review': forms.Textarea(attrs={'placeholder': _(u'Отзыв')})
|
|
}
|
|
|