Commits

Benjamin Klüglein committed 1305748

Renamed File model to UploadedFile

  • Participants
  • Parent commits b5938f9
  • Branches upload_ticket

Comments (0)

Files changed (3)

 from datenaustausch.upload.models import *
 from django.contrib import admin
 
-admin.site.register(File)
+admin.site.register(UploadedFile)
 admin.site.register(UploadTicket)
 
 
 UPLOAD_DIR = "uploaded_files"
 
-class File(models.Model):
+class UploadedFile(models.Model):
     owner = models.ForeignKey(User)
     name = models.CharField(max_length=128, blank=False, null=False)
     description = models.TextField(max_length=512)
         return path.basename(self.file_on_fs.name)
 
 class UploadTicket(models.Model):
-    referenced_file = models.ForeignKey(File, null=True, blank=True)
+    referenced_file = models.ForeignKey(UploadedFile, null=True, blank=True)
     identifier = models.CharField(max_length=48, blank=True, unique=True)
     created_by = models.ForeignKey(User)
     created_at = models.DateTimeField("Created at", auto_now=True)
 from django.http import HttpResponse, Http404, HttpResponseForbidden
 from django.shortcuts import render_to_response, get_object_or_404
 
-from datenaustausch.upload.models import File
+from datenaustausch.upload.models import UploadedFile
 from datenaustausch.upload.forms import DownloadFileForm
 
 def download(request, download_id):
-    f = get_object_or_404(File, pk=download_id)
+    f = get_object_or_404(UploadedFile, pk=download_id)
     if request.method == 'GET':
         form = DownloadFileForm()
         return render_to_response("templates/upload/show_download.html", {"download" : f,