django-fields

How do I properly format a StringIO object(python and django) to be inserted into an database?

I have a requeriment to store images in the database using django, and for that I created a custom field : from django.db import models class BlobField(models.Field): __metaclass__ = models.SubfieldBase def db_type(self, connection): #TODO handle other db engines backend = connection.settings_dict['ENGINE'] ...

how to customize sorting order in django ForeignKey field

Hello. I have this code: class Article(models.Model): # usefull staff category = models.ForeignKey("Category") class Category(models.Model): parent = models.ForegnKey('self') I want to display categories selector as a <select> field with sorted category tree in it. It should look like top level category1 lower level...