structure_of_events_changed
This commit is contained in:
parent
ee28047b02
commit
aa73b7a08f
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5,4 +5,4 @@ from .models import Event
|
||||
class EventForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Event
|
||||
fields = ('title', 'data', 'place')
|
||||
fields = ('title', 'data', 'place', 'description')
|
23
highneed/events/migrations/0003_auto_20211220_2335.py
Normal file
23
highneed/events/migrations/0003_auto_20211220_2335.py
Normal file
@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.1.7 on 2021-12-20 22:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('events', '0002_event_pub_date'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='data',
|
||||
field=models.CharField(max_length=200),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='place',
|
||||
field=models.CharField(max_length=500),
|
||||
),
|
||||
]
|
19
highneed/events/migrations/0004_event_description.py
Normal file
19
highneed/events/migrations/0004_event_description.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.1.7 on 2021-12-20 22:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('events', '0003_auto_20211220_2335'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='event',
|
||||
name='description',
|
||||
field=models.TextField(default=0),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
18
highneed/events/migrations/0005_auto_20211220_2356.py
Normal file
18
highneed/events/migrations/0005_auto_20211220_2356.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.1.7 on 2021-12-20 22:56
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('events', '0004_event_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='data',
|
||||
field=models.DateField(),
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5,8 +5,9 @@ from django.utils import timezone
|
||||
class Event(models.Model):
|
||||
pub_date = models.DateTimeField('Date: ')
|
||||
title = models.CharField(max_length=200)
|
||||
data = models.CharField(max_length=11)
|
||||
place = models.CharField(max_length=200)
|
||||
description = models.TextField() #NEW
|
||||
data = models.DateField() #Date of Event
|
||||
place = models.CharField(max_length=500)
|
||||
|
||||
def __str__(self):
|
||||
return self.title + ' | ' + self.data + ' | ' + self.place
|
||||
return self.title + ' | ' + str(self.data) + ' | ' + self.place
|
||||
|
@ -14,16 +14,7 @@
|
||||
</form>
|
||||
<a href="../">Cancel</a>
|
||||
|
||||
<form action="" method="POST" class="post_form">
|
||||
{% csrf_token %}
|
||||
<label for="event_title">Nazwa: </label>
|
||||
<input id="event_title" type="text" name="event_title" value="{{ current_name }}">
|
||||
<label for="event_date">Data: </label>
|
||||
<input id="event_date" type="text" name="event_date" value="{{ current_name }}">
|
||||
<label for="event_place">Miejsce: </label>
|
||||
<input id="event_place" type="text" name="event_place" value="{{ current_name }}">
|
||||
<button type="submit" class="btn btn-success">Save</button>
|
||||
</form>
|
||||
|
||||
<a href="../">Cancel</a>
|
||||
</body>
|
||||
</html>
|
@ -16,8 +16,9 @@
|
||||
|
||||
{% for i in latest_news_list %}
|
||||
<p>Nazwa: {{ i.title }}</p><b></b>
|
||||
<p>Data: {{ i.data }}</p><b></b>
|
||||
<p>Miasto: {{ i.place }}</p><b></b>
|
||||
<p>Opis: {{ i.description }}</p><b></b>
|
||||
<p>Gdzie sie odbedzie: {{ i.place }}</p><b></b>
|
||||
<p>Kiedy sie odbedzie: {{ i.data }}</p>
|
||||
<p>Opublikowane: {{ i.pub_date }}</p><br>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
|
@ -25,6 +25,7 @@ def index(request):
|
||||
'Title': Event.title,
|
||||
'Data': Event.data,
|
||||
'Place': Event.place,
|
||||
'description': Event.description,
|
||||
'numofnews': numofnews,
|
||||
}
|
||||
|
||||
@ -49,6 +50,7 @@ def events(request):
|
||||
'Title': Event.title,
|
||||
'Data': Event.data,
|
||||
'Place': Event.place,
|
||||
'description': Event.description,
|
||||
'numofnews': numofnews,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user