No, this is not a mistake; perhaps the argument that the default behavior can be improved, but the existing implementation is a reasonable first pass (as evidenced by the fact that it works with integers, strings, foreign keys, etc.). There is enough metadata about the model and enough deserialization code that processing could be improved a bit here, but I don't think this is a mistake.
The good news is that there is an official way to handle this; in the ModelAdmin class ModelAdmin define:
def get_changeform_initial_data(self, request):
This method accepts the request and converts this request to a value that will be passed as an argument to the initial form in the change list (for example, the add or edit page in Admin). As you would expect, the default implementation of this method is "accept GET arguments and convert to a dictionary"; if you do some extra processing for fields that you know are datetime, then
In addition, you do not have to use a query object. If you know that Person objects will always have an Unknown start name and a start date of January 1, 2014, then you can simply write:
class PersonAdmin(ModelAdmin): ... def get_changeform_initial_data(self, request): return { 'name': 'Unknown', 'start_date': date(2014, 1, 1) }
ie, ignore the request data, just enter the initial data manually. Since this is the source data in the form, any existing data about the object will override the value specified in initial , and that the source data will be used without the user having to provide any GET arguments in his request.