python - django-excel importing files without overwrite the database -
i'm developing web-app manage data have in excel , csv files. i'm using django-excel in order import files in database (the default of django-framework) of web-app.
i read documentation , find import function:
def import_sheet(request): if request.method == "post": form = uploadfileform(request.post, request.files) if form.is_valid(): request.files['file'].save_to_database( name_columns_by_row=2, model=question, mapdict=['question_text', 'pub_date', 'slug']) return httpresponse("ok") else: return httpresponsebadrequest()
that import data of 1 file in database. can't import file without having error. how can import data file appending them, without overwriting database?
[edit after question of solarissmoke]
i explain myself example: have table mytable in database. import file first time , data stored in mytable. (i modified above function model) when try import different file in table, in order append other data, overwrite data stored.
Comments
Post a Comment