How to add records from Django (version 1.5) admin when the database (PostgreSQL) is partitioned? -
i know whether possible add new records database django (version 1.5) admin when database (postgresql) has been partitioned?
more specifically, in database have partitioned (via use of triggers) table named category
2 partitions named category_01
, category_02
.
after finished partitioning table, tried insert new records kept getting following error:
'nonetype' object has no attribute '__getitem__'
.
does have idea on how solve problem? have tried add custom save()
method model well, no avail. simplest solution here?
after 2 days of research, able solve issue on own. solution override save(..)
method in model so:
def save(self, *args, **kwargs): #custom save method #pdb.set_trace() django.db import connection connection.features.can_return_id_from_insert = false print "save" super(your model name here, self).save(*args, **kwargs)
thanks django docs , postgresql docs, https://groups.google.com/forum/?fromgroups=#!topic/django-users/-at4plomwae , https://code.djangoproject.com/ticket/10467 helping me solve issue!