Compare commits
No commits in common. "fe97e02e41e8c9bd6c1333711d1cb37fc676b110" and "172e462d1ddf146d7a10fd0d672136ff40ded4e5" have entirely different histories.
fe97e02e41
...
172e462d1d
@ -1,14 +1,14 @@
|
|||||||
# lostplaces-backend
|
# 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
|
## 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.
|
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.
|
* [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
|
### Setting up a (pipenv) virtual environment for development
|
||||||
|
|
||||||
|
@ -49,5 +49,7 @@ class PlaceImageCreateForm(forms.ModelForm):
|
|||||||
|
|
||||||
self.fields['filename'].required = False
|
self.fields['filename'].required = False
|
||||||
|
|
||||||
class PlaceDeleteForm(forms.Form):
|
class PlaceDeleteForm(forms.ModelForm):
|
||||||
confirm_check = forms.CheckboxInput()
|
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'%}
|
{% extends 'global.html'%}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
# {% block title %}Update place{% endblock %}
|
# {% block title %}Place aktualisieren{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">Update place</legend>
|
<legend class="LP-Form__Legend">Place aktualisieren</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="LP-Form__Composition">
|
<div class="LP-Form__Composition">
|
||||||
<input type="submit" class="LP-Button" value="Submit"/>
|
<input type="submit" class="LP-Button" value="Abschicken"/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
''' Django views. '''
|
''' Django views. '''
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.urls import reverse_lazy
|
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.views import View
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
|
from django.views.generic.edit import UpdateView
|
||||||
|
|
||||||
from .forms import (
|
from .forms import (
|
||||||
ExplorerCreationForm,
|
ExplorerCreationForm,
|
||||||
@ -96,14 +97,12 @@ class PlaceCreateView(View):
|
|||||||
place_image.save()
|
place_image.save()
|
||||||
|
|
||||||
class PlaceDeleteView(View):
|
class PlaceDeleteView(View):
|
||||||
#template_name = 'delete_place.html'
|
template_name = 'delete_place.html'
|
||||||
#model = Place
|
model = Place
|
||||||
#form_class = PlaceDeleteForm
|
form_class = PlaceDeleteForm
|
||||||
|
|
||||||
def get(self, request, pk, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
place = Place(pk=pk)
|
|
||||||
print(pk, place.name)
|
|
||||||
place_delete_form = PlaceDeleteForm()
|
place_delete_form = PlaceDeleteForm()
|
||||||
|
|
||||||
context = {'place': place, 'form': place_delete_form}
|
context = {'place_form': place_delete_form}
|
||||||
return render(request, 'delete_place.html', context)
|
return render(request, 'create_place.html', context)
|
||||||
|
Loading…
Reference in New Issue
Block a user