~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlimages/views.py

  • Committer: kaputtnik
  • Date: 2019-06-14 18:40:56 UTC
  • mfrom: (532.1.31 widelands)
  • Revision ID: kaputtnik-20190614184056-l0ha8pm5zais9mxk
Adapted code for use with python 3.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from django.http import HttpResponse, HttpResponseRedirect
4
4
from django.shortcuts import get_object_or_404, render
5
5
 
6
 
from models import Image
7
 
from forms import UploadImageForm
 
6
from .models import Image
 
7
from .forms import UploadImageForm
8
8
 
9
9
 
10
10
def display(request, image, revision):
37
37
 
38
38
    # Get the App (model) to which this image belongs to:
39
39
    app = ContentType.objects.get(id=content_type)
40
 
    # Get the current object's name (provided by __unicode__()) from this model
 
40
    # Get the current object's name (provided by __str__()) from this model
41
41
    name = app.get_object_for_this_type(id=object_id)
42
42
 
43
43
    return render(request, 'wlimages/upload.html', {