Задать вопрос

Тел: +7 965 3737 888

415

Просмотров

1

Ответов

ImageField for Google App Engine

This is a replacement for Django's built-in ImageField. It uses the Google AppEngine image APIs in order to validate.

Notes:

  1. Validation of the field counts against your App Engine transformations quota.
  2. This code assumes you're only using the in-memory file upload handler. None of the other stock handlers work well on App Engine; you should probably disable them.

Вопрос полезен? Да0/Нет0
file_4067.py(1.7Кб)
None

Ответы (1):

Ответjohnecon:08.07.2012
Ответ полезен? Да0/Нет0

hello dave! I would like to use this snippet which seems exactly what i need. So under Event/models.py i have something like this

class Event(models.Model): title = models.CharField(max_length=200) address = models.CharField(max_length=200) image = AppEngineImageField()

and under Event/admin.py I have the following class

class EventAdmin(admin.ModelAdmin): list_display = ('address', 'image', 'category', 'description', 'title', 'activationDate', 'expiryDate', 'isExpired') search_fields = ['title']

admin.site.register(Event, EventAdmin)

But when i go to admin area to add a new event unfortunately i am not able to upload an image to my event.. Any suggestions??