461 questions
0
votes
0
answers
61
views
django-import-export id auto generated by the package during insert?
I'm using django-import-export and trying to work it with multi-thread concurrency.
I tried logging the sql queries and notice that INSERT query has id values generated as well.
*EDIT: First there's a ...
0
votes
0
answers
89
views
I am trying to import categories but lines that have a parent is causing an issue
I have an empty product category table and I am trying to import categories from a csv file
and I can import other categories for other apps but not for products so I had the csv file checked and I'm ...
0
votes
1
answer
152
views
Django import-export import foreign keys that do not exist
I'm having a hard time understanding the import concept.
How can I create the board after the person and organization were imported?
Where is the final board creation missing? i.e. Board(person=p, ...
0
votes
0
answers
43
views
Export command not found in working django import-export app
I'm trying to reproduce the export command as shown in the import-export docu
python manage.py export CSV auth.User
yet all I get is:
Unknown command: 'export'.
Type 'manage.py help' for usage.
...
1
vote
1
answer
56
views
django import_export lib buttons not showing in admin site
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import members
@admin.register(members)
class MembersAdmin(ImportExportModelAdmin):
pass
this ...
1
vote
2
answers
78
views
How to export to Excel Django object where every ForeignKey object a new column with import-export lib?
I have a model represents some item on stock:
(Code has been simplified)
class StockItem(models.Model):
name = models.CharField()
category = models.Charfield()
stock = models.ForeignKey(...
0
votes
1
answer
268
views
django-import-export: Customizable storage not working with minio
Following the documentation, I'm trying to configure the library to store temporary import files from the admin page into a MinIO bucket.
This is my STORAGES configuration:
...
0
votes
1
answer
82
views
Django-Import-Export: delete field causes import to stop working
I have a Django model that I want to import from the admin panel using django-import-export.
Everything works fine without the delete field. Here is my resource code:
class DeviceResource(resources....
0
votes
0
answers
216
views
django-import-export, using the foreign key widget
I seem to be having some issues trying to figure out how to use the ForeignKeyWidget in the django-import-export package. I'm hoping someone here will be able to point out what is wrong with my code. ...
0
votes
1
answer
93
views
ForeignKeyWidget in django-import-export Showing ID Instead of Custom Column Value
I am using the django-import-export library to handle data import and export in my Django application. I have several models with ForeignKey relationships, and I want to display and use the custom ...
0
votes
0
answers
92
views
Django Admin Import Error: NOT NULL Constraint Failed for ForeignKey Field in CSV Import
I'm experiencing a persistent issue with importing CSV data into my Django project using the django-import-export library in the admin panel. When trying to import records for a Copy model which has ...
1
vote
1
answer
247
views
How to cache get_queryset() when using ForeignKeyWidget
I am importing data using django-import-export but because I use ForeignKeyWidgets there are a lot of database calls making the import very slow for only a few 100 rows (checked with django-debug-...
0
votes
1
answer
309
views
How to dynamically change resource class in Django Import-Export admin based on user group?
I am using Django Import-Export library to manage export functionalities in my Django admin interface. I have a requirement where I need to dynamically change the resource class based on the user's ...
0
votes
1
answer
489
views
Django Admin "Export selected" button not showing in Django Admin
I'm trying to enable the "Export selected" button in the Django admin for users to download data as an Excel sheet. I'm using django-import-export but the button isn't appearing.
Here's what ...
0
votes
0
answers
51
views
Export shows badgateway in nginx
`I am using an import-export model in my Django admin panel it works very well...if the records goes more means on that time also i am export means it gives an error like Bad Gateway...if i click ...
-2
votes
1
answer
142
views
django "import excel to database" libraries [closed]
I need to do "import excel to database" using django.
I know that some of the libraries that help are "django-import-export", "openpyxl", and others are "pandas"...
1
vote
1
answer
78
views
Exporting data of non-related with the model
I'm using Django-import-export on django admin. I want to export the data that are not related. (Are related but it's weird..)
Example:
models.py
class A(models.Model):
name = models.CharField(...
0
votes
1
answer
149
views
Django-import-export does not work with 'delete' field
When importing with 'delete' field, it gives error:
BaseBoqItem has no field named 'delete'
I am also aware that this model doesn't have that field. That model should not have that field for sure, ...
1
vote
1
answer
306
views
Incompatability between django-import-export and jazzmin
The django project I'm working on has jazzmin installed and customizing the django admin panel. I was running into an issue where I could import django-import-export along with my model into the ...
1
vote
1
answer
76
views
How to create a separate column for each related field value while exporting data via django-import-export
I have a PaymentRecord model which stores user payments for event tickets. I have a TicketPurchase model which records which tickets were purchased by which PaymentRecord. So my models look something ...
0
votes
1
answer
425
views
Issues with Django Import-Export: Validation Errors during CSV Import
I am currently working on a Django project where I'm using the django-import-export library to import CSV data into my models through the Django admin interface. I have set up resources, models, and ...
0
votes
2
answers
601
views
How to export large dataset using django-import-export
I've integrated django-import-export in my admin, and it is working as expected. I have created a resource for the model I want to export, and the export works fine for smaller datasets. However, on ...
1
vote
0
answers
114
views
Getting KeyError: 'id' when importing a CSV file using django-import-export
I am tring to update sqlite data by importing a csv file to django admin, only to get the error message for each single record I upload:
Line number: 1 - 'id'
Traceback (most recent call last):
...
...
0
votes
0
answers
82
views
How can I post data to django import_export
I would like to test the import function from import_export django. When I run my test the code says I provide no dataset (None) even though I do provide a proper CSV file. Thus, my assertions (...
0
votes
1
answer
112
views
How do I test ExportActionMixin in Django?
I'd like to test files produced on the admin website by import_export.admin.ExportActionMixin in Django.
In particular I'd like to test the admin command by looking into the file (which I download on ...
0
votes
1
answer
57
views
Django admin custom form with uploading data
I've a question.
I need to add second functionality to may Django Administration panel:
I have 2 models (City and Region), one Region has many Cities in it;
In my admin panel I want to add excel file ...
0
votes
1
answer
400
views
Django-import-export. Export selected records only?
I'm using the great django-import-export addition.
We standard have 2 options import and export. I would like to have an extra option to export selected records only. Would be a nice addition. How can ...
0
votes
1
answer
44
views
Override error representation on import model page django
I'm working with a django application and don't wanted to show users the stack trace when there is any error occurred in production.
For example, I've added validation to validate import action under ...
0
votes
0
answers
266
views
Django-import-export library - No such file or directory: '/tmp/tmp5bcxsx9p'
I have a problem with the django-import-export library because when I try to import excel or csv files it gives me error 500, and the error returned is the following
FileNotFoundError
[Errno 2] No ...
-1
votes
1
answer
116
views
why is django import export not working for me
I have the following model for a website category
class Category(models.Model):
name = models.CharField(max_length=50)
description = models.TextField(max_length=500, blank=True, null=True)
...
0
votes
1
answer
178
views
django-import-export Customize Admin Missing Field Error
I am using django-import-export to manage csv uploads. I have the following import working vanilla and now want to extract the 'league' and 'season' fields from the .csv and instead choose them via ...
0
votes
1
answer
76
views
Import a ManyToMany field
I have a Agent class model
class Agent(models.Model):
registration_number = models.CharField(max_length=50, unique=True)
first_name = models.CharField(max_length=50)
last_name = ...
0
votes
1
answer
453
views
django-import-export "Errors: line number : 1 - 'id' " - "KeyError: id"
I have a model for driving schools in Denmark. When I try to import them form and .xlsx file, I get the following error:
Errors
Line number: 1 - 'id'
43959328, 2023-03-20, None, Autoskolen.com ApS, ...
1
vote
1
answer
77
views
Passing kwargs from Resource to widget
I've been working with django import_export and I wanted to pass kwargs from the resource to the clean field of my custom widget validator. how can i do that
here's my code
resources.py
class ...
0
votes
2
answers
490
views
How to use django-admin-sortable2 and django-import-export package together in admin panel?
I want to use django-admin-sortable2 django-import-export package together in admin panel.
Here is the code:
class University(models.Model):
name = models.CharField(max_length=50, help_text="...
0
votes
1
answer
121
views
Django on GCP failed to import CSV file using import-export
I have setup a model in Django and there is a requirement to allow editor to update records using CSV import.
I installed import-export, following the guide from django-import-export and setup the ...
-1
votes
1
answer
54
views
Can't migrate my API application through Djangorestframework
I tried to migrate my models to the Django administration website to trake my datasets progress and modify them. However, when I insert the indicated command in the attached picture in the Visual ...
0
votes
1
answer
391
views
django.import-export ImportExportMixin customisation
I am using ImportExportMixin to add the import export buttons to my admin page:
i write it like this :
from django.contrib import admin
from .models import *
from import_export.admin import ...
1
vote
1
answer
401
views
How to register django-import-export-celery on a custom adminsite
I'm building an app that use only django admin. I'm using two different adminsite in two different url, say admin and myadmin. I've installed django-import-export and django-import-export-celery ...
0
votes
1
answer
466
views
Django-import-export is not getting imported in admin.py
I am trying to use django-import-export library to provide excel data upload action in the admin panel.
I have done following
pip install django-import-export
Have added it to installed apps
...
0
votes
1
answer
482
views
How to handle django import-export 'matching query does not exist.' error?
I am using import-export library and trying to add import functionality in admin panel.
Resource:
class DictCitizen_FisResources(resources.ModelResource):
id = fields.Field(
column_name='№',
...
0
votes
1
answer
66
views
How to update a foreignkey instance model value on import
I've got 2 models :
class Fund(LabsManagerBudgetMixin, ActiveDateMixin):
ref= models.CharField(max_length=30, blank=True, verbose_name=_('Reference'))
start_date=models.DateField(null=True, ...
0
votes
1
answer
40
views
Getting mistake while importing xlsx file into database django. Please correct my code. I cant deal with it. PLEASE
Line number: 1 - 'id'
1, 28799772, 306509594, "GOLDEN NILE AAA" MChJ, 1726294, Toshkent shahri,
Chilonzor tumani, X.TURSUNQULOV KOʻCHASI, 38-UY, 974079981, [email protected], ...
1
vote
1
answer
1k
views
Using django-import-export: How to customise which fields to export Excel files
I just starting out using Django. I'm using django-import-export package and I tried to customize my Django admin panel in this page in order to choose which fields to export to excel file.
Here is my ...
0
votes
1
answer
164
views
Use import_export django library to import personnalized export CSV
I have two action in my application.
First I export data to CSV using specific resources (see below) to have personalized Headers and Name of specific foreign Key instead Id.
It's OK for Export CSV ...
0
votes
1
answer
82
views
Import data containing title instead of ID in django
I am using django-import-export. It is an extension used to import tables of data to the admin panel using a csv file. I have a model with a foreign key : ProductModel, now if i want to import data i ...
0
votes
0
answers
114
views
How i can to use django-import-export with a django-mptt?
In the project i used 2 packages "django-import-export" and "django-mptt" url follow below.
django-import-export : https://django-import-export.readthedocs.io/en/latest/
django-...
0
votes
1
answer
531
views
Django import-export - Import model with child from excel
I have two models: Project and Activity.
When registering a project, one or more associated activities can be added.
How can I import projects from xlsx, which include at least one activity?. I'm ...
0
votes
3
answers
447
views
when I export posts from django I get <django_quill.fields.FieldQuill object at 0x7f0746389840>?
I'm working on Django blog and I want to export posts and I made it work but I have a problem when exporting text because I used Quill - rich text editor and Django Import Export
body = QuillField()
...
2
votes
1
answer
872
views
Export only the data registered by the user / Django import-export
Products can be exported in excel format from the Product table. But all the user's products are exported.
How can I export only request.user's products?
Here is view :
def export_excel(request):
...