Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
red_brick_board
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ciella Francisco
red_brick_board
Commits
67abdece
Commit
67abdece
authored
Apr 11, 2024
by
Ciella Francisco
😵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the form to be used in creating new events in the front-end side
parent
9020a682
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
forms.py
redbrickboard/event_management/forms.py
+17
-0
event-form.html
...ent_management/templates/event_management/event-form.html
+26
-0
No files found.
redbrickboard/event_management/forms.py
View file @
67abdece
from
accounts
import
models
as
accounts
from
django
import
forms
from
.models
import
Event
# class EventForm(forms.ModelForm):
# class Meta:
# model = Event
# fields = ["event_name", "event_datetime_start", "event_datetime_end", "event_organizer", "event_header", "last_time_bumped"]
class
EventForm
(
forms
.
Form
):
event_name
=
forms
.
CharField
(
label
=
'Event Name'
,
max_length
=
150
)
event_datetime_start
=
forms
.
DateTimeField
(
label
=
'Event Start Date and Time'
)
event_datetime_end
=
forms
.
DateTimeField
(
label
=
'Event End Date and Time'
)
event_organizer
=
forms
.
ModelChoiceField
(
label
=
'Event Organizer'
,
queryset
=
accounts
.
CustomUser
.
objects
.
all
(),
)
event_header
=
forms
.
ImageField
(
label
=
'Event Header Photo'
)
last_time_bumped
=
forms
.
DateTimeField
(
label
=
'Last Time Bump'
)
\ No newline at end of file
redbrickboard/event_management/templates/event_management/event-form.html
0 → 100644
View file @
67abdece
{% extends 'base.html' %}
{% block event_form %}
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"
></script>
<link
href=
"{{ STATIC_URL }}css/bootstrap.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"{{ STATIC_URL }}js/bootstrap.js"
></script>
{{ form.media }}
{% endblock %}
{% load static %}
{% block title %}Widget's Forum{% endblock %}
{% block content %}
{ form.non_field_errors }
{% for field in form %}
{% if field.errors %}
<p>
{{ field.label }} has the following errors:
</p>
<ul>
{% for error in field.errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<form
action=
"/add"
method=
"post"
>
{% csrf_token %}
{{ form }}
</form>
{% endblock %}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment