10:58 AM
Ahuj has quit
10:58 AM
moldy
fub: text fields in particular should not use null=True
10:59 AM
fub
okay, because then django import-export fails
10:59 AM
moldy
10:59 AM
fub
(with an empty field)
10:59 AM
moldy
fub: as i said before: fix your import, not your models.
10:59 AM
fub
ok, so then I will write some custom import method.
11:00 AM
question for this: what in your experience is easier to work with, a CSV import or an EXCEL import? Because I can tell my import users to convert to CSV before
11:00 AM
I just have to work around the strange excel to csv export mess
11:01 AM
moldy
pandas can be useful for importing excel
11:01 AM
Ahuj joined the channel
11:02 AM
kiloreux joined the channel
11:02 AM
kiloreux_ joined the channel
11:02 AM
fub
ok
11:03 AM
moldy: thanks for your help. any article suggestion with a starting point?
11:03 AM
moldy
probably the pandas doc
11:03 AM
fub
moldy: I mean regarding the admin import
11:03 AM
moldy
or maybe openpyxl instead
11:03 AM
fub
I looked at a few things, but most of them explained how to add somethign to the action dropdown
11:04 AM
moldy
fub: read the django-import-export docs to see how to fix the NULL problem
11:04 AM
somsom has quit
11:04 AM
it's probably easier than you think. showing us the code might also help.
11:05 AM
agrawalritesh joined the channel
11:07 AM
fub
11:08 AM
you can ignore the CustomImportForm for now, as you can see I commented it out in L47-50. I had hoped to let the user using the import form is able to "overwrite" the organization, but I fought hours with this and then gave up.
11:08 AM
but this is another problem
11:08 AM
the not-null constraint for example fails for the postcode field
11:10 AM
moldy
fub: tell django-import-export to pass "" instead of None for empty values
11:11 AM
11:11 AM
kezabelle has quit
11:12 AM
btw, that get_instance() method looks weird
11:13 AM
fub
moldy: I had to use this because otherwise I get an error because of the "id" (pk, auto inc field) fails
11:14 AM
this get_instance() tells its a new record, so an id is created
11:14 AM
agrawalritesh has quit
11:14 AM
moldy
hmm, sounds weird
11:15 AM
fub
moldy: indeed, but I did not find a better workaround.
11:15 AM
agrawalritesh joined the channel
11:17 AM
moldy
i am pretty sure you are doing something wrong somewhere to cause that problem in the first place. full traceback might help.
11:17 AM
11:19 AM
fub
11:19 AM
moldy
fub: i guess that is because you have `id` in exclude?
11:22 AM
fub
11:22 AM
but it comes again to a keyerror
11:22 AM
moldy
fub: is the import supposed to *only* create new records, or to also update existing ones?
11:23 AM
damienxx joined the channel
11:23 AM
azulakina has quit
11:24 AM
fub
moldy: only import
11:24 AM
(create new records)
11:24 AM
moldy
ok, in that case i guess you can keep the get_instance() override
11:25 AM
your users will need to be careful not to create lots of duplicate records
11:25 AM
sunil_bansal joined the channel
11:25 AM
sunil_bansal joined the channel
11:26 AM
your Customer model has no unique field except for `id`. if someone imports a file with 10 customers 5 times, you will end up with 50 customer records
11:26 AM
g_kub joined the channel
11:27 AM
fub
yeah, thats why I only want this functionality in the admin panel
11:27 AM
so only admin knowing how this works can use it
11:34 AM
wreed has quit
11:34 AM
theo_moore has quit
11:35 AM
moldy: coming back to the organization field, do you have any idea how I can make this field selectable in the form?
11:36 AM
I manage to show this field in the form, but its not correctly used to set this field for all values
11:36 AM
*to set this selected value from the form for all imported fields
11:38 AM
esrse has quit
11:39 AM
nix64bit has quit
11:40 AM
robotme
how to mock test class all method
11:45 AM
moldy
fub: not from the top of my head. will need custom code.
11:45 AM
maybe create the ImportResource dynamically or such
11:47 AM
Ahuj has quit
11:47 AM
encod3 joined the channel
11:51 AM
chasonchaffin joined the channel
11:52 AM
tdy joined the channel
11:53 AM
Ahuj joined the channel
11:53 AM
csotelo_ joined the channel
11:53 AM
agrawalritesh has quit
11:54 AM
Leeds joined the channel
11:55 AM
g_kub has quit
11:57 AM
agrawalritesh joined the channel
11:57 AM
andyhoang joined the channel
11:58 AM
tdy has quit
12:00 PM
pwrentch joined the channel
12:01 PM
chasonchaffin has quit
12:06 PM
amcorreia joined the channel
12:06 PM
LordVan joined the channel
12:06 PM
packi has quit
12:06 PM
fub
moldy: ok
12:07 PM
so my current problem is that when importing excel, it is trying to import like and endless amount of empty rows at the end
12:07 PM
which ofc fails because of constraints
12:07 PM
blip99 has quit
12:08 PM
moldy
well, insert some check for empty rows and just skip them
12:12 PM
fub
moldy: can you point me to where to add checks? is it in import_data() ?
12:15 PM
moldy
fub: don't know from the top of my head, sorry.
12:15 PM
12:15 PM
markb1 joined the channel
12:17 PM
d21d3q
can i have some quick question?
12:17 PM
mebus
yes
12:21 PM
Ergo joined the channel
12:23 PM
azulakina joined the channel
12:24 PM
lizx6451 joined the channel
12:24 PM
Haudegen joined the channel
12:25 PM
asimon joined the channel
12:27 PM
bkxd joined the channel
12:32 PM
bkxd has quit
12:34 PM
lizx6451 has quit
12:35 PM
enoq joined the channel
12:36 PM
greg_f has quit
12:41 PM
raposinha joined the channel
12:43 PM
graphene joined the channel
12:52 PM
astronavt joined the channel
12:52 PM
usr123 has quit
12:53 PM
drodger has quit
12:53 PM
mitaka has quit
12:54 PM
BSLang has quit
12:54 PM
astronavt_ joined the channel
12:56 PM
chasonchaffin joined the channel
12:58 PM
drodger joined the channel
12:58 PM
astronavt has quit
12:59 PM
xliiv joined the channel
12:59 PM
agrawalritesh has quit
12:59 PM
Xaldafax joined the channel
13:00 PM
kyern has quit
13:02 PM
greg_f joined the channel
13:04 PM
bkxd joined the channel
13:04 PM
nazarewk has quit
13:06 PM
chasonchaffin has quit
13:10 PM
azulakina has quit
13:11 PM
Kangermu joined the channel
13:13 PM
azulakina joined the channel
13:15 PM
jhoskins98 joined the channel
13:15 PM
EyePulp joined the channel
13:16 PM
GraysonBriggs joined the channel
13:16 PM
agrawalritesh joined the channel
13:23 PM
rsrx joined the channel
13:30 PM
Keyra1 joined the channel
13:31 PM
Keyra1
hello
13:32 PM
Keyra1 is now known as Kejra
13:33 PM
Kejra
Hello, can someone tell me if there is any other django community and support platform aside from the google groups mailing list?
13:35 PM
jtiai
irc. Those are two official support channels.
13:35 PM
adsworth joined the channel
13:37 PM
marcosmoyano joined the channel
13:39 PM
JustSighDudes has quit
13:40 PM
ubernost1um joined the channel
13:41 PM
Kejra
@jtiai, you mean this channel and a second one?
13:41 PM
marcosmoyano has quit
13:41 PM
jtiai
There is no second one. only this. and the mailinglist.
13:43 PM
ubernostrum has quit
13:43 PM
dodobas
Kejra: and there is professional support
13:43 PM
swi joined the channel
13:46 PM
Kejra
ah ok, I was looking for something like a forum, unfortunate that there is not...
13:47 PM
EyePulp
stackoverflow has lots of django entries.
13:48 PM
jtiai
Of course using stackoverflow requires that you really know which answers are valid... :)
13:48 PM
EyePulp
Lots of *solved* django entries. =P