Compare commits
No commits in common. "fe97e02e41e8c9bd6c1333711d1cb37fc676b110" and "172e462d1ddf146d7a10fd0d672136ff40ded4e5" have entirely different histories.
fe97e02e41
...
172e462d1d
@ -1,14 +1,14 @@
|
||||
# lostplaces-backend
|
||||
|
||||
lostplaces-backend is a django (3.x) based webproject. It once wants to become a software which allows a group of urban explorers to manage, document and share the locations of lost places while not exposing too much / any information to the public.
|
||||
lostplaces-backend is a django based Webproject. It once wants to become a software which allows a group of urban explorers to manage, document and share the locations of lost places while not exposing too much / any information to the public.
|
||||
|
||||
The software is currently in early development status, neither scope, datalmodel(s) nor features are finalized yet. Therefore we would not recommend to download or install this piece of software anywhere - except your local django dev server.
|
||||
The software ist currently in early development status, neither scope, datalmodel(s) nor features are finalized yet.
|
||||
|
||||
## Dependencies
|
||||
Right now it depends on the following non-core Python 3 libraries. These can be installed using the package manager of your distribution or into the venv locally.
|
||||
|
||||
* [django](https://www.djangoproject.com/) django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
|
||||
* [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) A powerful, yet easy to implement thumbnailing application for Django 1.11+
|
||||
* [easy-thumbnais](https://github.com/SmileyChris/easy-thumbnails) A powerful, yet easy to implement thumbnailing application for Django 1.11+
|
||||
|
||||
### Setting up a (pipenv) virtual environment for development
|
||||
|
||||
|
@ -49,5 +49,7 @@ class PlaceImageCreateForm(forms.ModelForm):
|
||||
|
||||
self.fields['filename'].required = False
|
||||
|
||||
class PlaceDeleteForm(forms.Form):
|
||||
confirm_check = forms.CheckboxInput()
|
||||
class PlaceDeleteForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Place
|
||||
fields = ['name']
|
||||
|
@ -1,18 +0,0 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Lost Place Deletion{% endblock %}
|
||||
|
||||
{% block maincontent %}
|
||||
<form class="" method="POST" enctype="multipart/form-data">
|
||||
<fieldset class="">
|
||||
<legend class="">Delete place</legend>
|
||||
{% csrf_token %}
|
||||
<p>Are you sure you want to delete {{place.name}}?</p>
|
||||
{{ form.as_p }}
|
||||
<div class="">
|
||||
<input type="submit" class="LP-Button" value="Delete"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endblock maincontent %}
|
@ -1,12 +1,12 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
|
||||
# {% block title %}Update place{% endblock %}
|
||||
# {% block title %}Place aktualisieren{% endblock %}
|
||||
|
||||
{% block maincontent %}
|
||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||
<fieldset class="LP-Form__Fieldset">
|
||||
<legend class="LP-Form__Legend">Update place</legend>
|
||||
<legend class="LP-Form__Legend">Place aktualisieren</legend>
|
||||
{% csrf_token %}
|
||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||
<div class="LP-Form__Field">
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
|
||||
<div class="LP-Form__Composition">
|
||||
<input type="submit" class="LP-Button" value="Submit"/>
|
||||
<input type="submit" class="LP-Button" value="Abschicken"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
@ -4,9 +4,10 @@
|
||||
''' Django views. '''
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic.edit import CreateView, UpdateView
|
||||
from django.views.generic.edit import CreateView
|
||||
from django.views import View
|
||||
from django.http import Http404
|
||||
from django.views.generic.edit import UpdateView
|
||||
|
||||
from .forms import (
|
||||
ExplorerCreationForm,
|
||||
@ -96,14 +97,12 @@ class PlaceCreateView(View):
|
||||
place_image.save()
|
||||
|
||||
class PlaceDeleteView(View):
|
||||
#template_name = 'delete_place.html'
|
||||
#model = Place
|
||||
#form_class = PlaceDeleteForm
|
||||
template_name = 'delete_place.html'
|
||||
model = Place
|
||||
form_class = PlaceDeleteForm
|
||||
|
||||
def get(self, request, pk, *args, **kwargs):
|
||||
place = Place(pk=pk)
|
||||
print(pk, place.name)
|
||||
def get(self, request, *args, **kwargs):
|
||||
place_delete_form = PlaceDeleteForm()
|
||||
|
||||
context = {'place': place, 'form': place_delete_form}
|
||||
return render(request, 'delete_place.html', context)
|
||||
context = {'place_form': place_delete_form}
|
||||
return render(request, 'create_place.html', context)
|
||||
|
Loading…
Reference in New Issue
Block a user