Skip to content

Commit

Permalink
inputs_checked
Browse files Browse the repository at this point in the history
  • Loading branch information
lucenasoft committed Nov 8, 2022
1 parent a820504 commit 11fa44c
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 2 deletions.
Binary file modified db.sqlite3
Binary file not shown.
Binary file modified feedback/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified feedback/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified feedback/__pycache__/views.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions feedback/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ class CategoryAdmin(admin.ModelAdmin):
@admin.register(Feedbacks)
class FeedbacksAdmin(admin.ModelAdmin):
list_display = ['author', 'email', 'message']
list_display_links = ['author', 'email']
search_fields = ['author', 'email']
list_filter = ['author', 'email']
1 change: 1 addition & 0 deletions feedback/forms/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .feedback_form import RegisterFeedback
Binary file added feedback/forms/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file not shown.
32 changes: 32 additions & 0 deletions feedback/forms/feedback_form.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from django import forms
from django.contrib.auth.models import User


class RegisterFeedback(forms.ModelForm):

author = forms.CharField(
required=True,
widget=forms.TextInput(attrs={
'placeholder': 'Nome completo'
}),
label='',
)

email = forms.CharField(
required=True,
widget=forms.TextInput(attrs={
'placeholder': 'E-mail válido'
}),
label='',
)

message = forms.CharField()

class Meta:
model = User
fields = [
'author',
'email',
'message',

]
9 changes: 7 additions & 2 deletions feedback/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from django.contrib import messages
from django.http import Http404
from django.shortcuts import render

from .models import Feedbacks
from .forms import RegisterFeedback


def feedback(request):
return render(request, 'pages/home.html')
form = RegisterFeedback()
return render(request, 'pages/home.html', {
'form': form,
})
6 changes: 6 additions & 0 deletions main_template/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ <h1>Get in Touch</h1>
<p>Have feedback or need some help?</p>
</div>
<div class="container-box">
{% for field in form %}
<div class="form-group-C">
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{field}}
</div>
{% endfor %}
</div>
</body>
<footer>
Expand Down

0 comments on commit 11fa44c

Please sign in to comment.