[Answered ]-Python django-tastypie object creation not returning data correctly

1👍

Actually I’ve solved the problem.

On the model, if you need to define the column name, as I did, don’t use IntegerField on a primary key.
Do it like this:

system = models.AutoField(primary_key=True, db_column="system_id")

The way tastypie looks after the newly created object, it needs the autoincrement defined on the model, so it knows the last created ID.
Good find, hope it helps someone someday.

1👍

You have to set in the meta class of the Resource:

always_return_data = True

And try your unique id field to be with default name id not service.

Leave a comment