Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to update image in django

from __future__ import unicode_literals

from django.db import models
from django.core.urlresolvers import reverse

class Server(models.Model):
    name = models.CharField(max_length=200)
ip = models.GenericIPAddressField()
order = models.IntegerField()
image = models.FileField(upload_to='pics/',default='download.jpg') 

def __unicode__(self):
    return self.name

def get_absolute_url(self):
    return reverse('server_edit', kwargs={'pk': self.pk})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #image #django
ADD COMMENT
Topic
Name
7+4 =