admin py -------------------- ---------------- from budget design mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# admin.py ------------------------------------
from budget.design.models import Template
from django.contrib import admin
from django import forms
class TemplateForm(forms.ModelForm):
archive_file = forms.FileField()
class TemplateAdmin(admin.ModelAdmin):
form = TemplateForm
admin.site.register(Template, TemplateAdmin)
# models.py ------------------------------------
from django.db import models
# Create your models here.
class Template(models.Model):
title = models.CharField(max_length=22)
screen_shoot = models.ImageField(upload_to='templates')
def __unicode__(self):
return self.title
def save(self):
raise Exception(self)
# тут хочу достать значение поля archive_file и не знаю как ;)