New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
During import, table id will not be auto-incremented #59
Comments
django-import-export uses standard Django ORM, I believe it auto-increment should be handled without any special work. One question - did you specify |
Thank you for the quick answer. At the beginning, I did not specify the It raised an error, this is why I included the Should I give it a try again without including the |
Yes, please try without specifying |
resources.py
admin.py
The error I get for each line, if I do not specify the
I thought of modifying the resources.py to the following:
In which case, nothing happened. Silence and no result. |
You should have let me know if this does not help. regards, On Fri, Dec 13, 2013 at 1:00 AM, raratiru notifications@github.com wrote:
Bojan Mihelac |
Thank you, it works great! |
Hello, Django is new for me. Error is as follows: Code is as follows def move_to_paid(modeladmin, request, queryset): class UserResource(resources.ModelResource): class CustomUserAdmin(ImportExportMixin,UserAdmin):
admin.site.unregister(Token) Thank you. |
Here is how to fix the database after this error:
Using IDs for new records looks like a reasonable usage for [backward] compatibility with some other database. |
@int-ua thanks for quick reply but where to put above code in admin.py or model ? |
It's a one-time solution, you can execute in Django shell ( |
sorry,but i don't understand. could you elaborate,please ? |
Please search Django and SQL database of your choice documentations for pieces you don't understand. No, it should not affect any existing records. |
Thanks int-ua. I don't need to do above suggested solution. my problem is solved. I was not using 'id' in export filter. |
Hi, The error signature here. Line number: 1 - 'NoneType' object is not iterable I have multiple models and data import is to be done on a daily basis. So I would also like to understand why and how this error is there, so I can make sure it doesnt happen in future. Will be grateful |
I am getting the same exact error in other table / model imports as well. I think now that it is more of a configuration / settings issue. Please help |
I am having the same problem and I would like to add that I need to import / export the ids to keep the relationships between the imported / exported data rows. Also this problem only seems to occur when using postgres afaik. I found this as a possibility to fix it manually:
This will fix the problem, but I can't do this everytime and for every table I import data into..
|
I have recently been experiencing the same problem as follow :
|
@drayendrff This is a very old issue, please open a new one. |
Running on:
I have successfully imported data from a csv file.
When I try to add more data manually, I receive the error:
From psql:
Does django-import-export support the table's id auto-incrementing?
The text was updated successfully, but these errors were encountered: