-
rpkilby has quit
-
zzing has quit
-
dhanush joined the channel
-
tonythomas joined the channel
-
limbera
solved my problem...
-
no idea what it was but a good reset seems to have fixed it
-
i must have been looking at the wrong files...
-
next question, django related!
-
is it possible to get the pk of a model instance before you call .save() on it
-
FunkyBob
if you've just constructed the model in memory it can't have a pk value [unless you assigned one... almost never a good move]
-
zkanda
limbera: I don't think that's even possible.
-
limbera
hmm
-
i've tried to use save(commit=False)
-
which i thought might do it, but regardless i am getting an error about using that
-
is that syntax not correct?
-
save() got an unexpected keyword argument 'commit'
-
wldcordeiro joined the channel
-
-
that's the view code in question
-
trustyhank has quit
-
zkanda
limbera: You don't even the commit=False there.
-
FunkyBob
commit=False explcitly does NOT touch the DB
-
zkanda
*need
-
limbera
gotcha
-
FunkyBob
see, once again... explain what you're trying to do up front
-
limbera
sure
-
FunkyBob
"I want to generate an order number based on the PK assigned to my instance"...
-
limbera
i suppose i could just make order_number default to ""
-
yeah i get cha
-
instead of asking what i think i am asking :P
-
i'm usually better i promise
-
(at asking!)
-
FunkyBob
I'd recommend you use a post-save signal to check (a) if it's created, and (b) if it has no order_no...
-
if so, update it and generate
-
and save
-
by having those tests in place you avoid infinite loop
-
limbera
sure i'll look into that
-
zkanda
I hate signals!
-
limbera
why would (b) ever be the case?
-
Broodoobob has quit
-
Dennis82 has quit
-
Broodoobob joined the channel
-
hmmm so i have just tried to simply add the field to the model instance
-
-
line 14 prints the order number to console as expected
-
but when i inspect in the admin it isn't present
-
this is the model
-
-
doughj3
can you use prefetch_related with a .filter?
-
zkanda
limbera: when you instantiate your model, can't you just put order_no there?
-
limbera
zkanda: the order_no is based on the model pk
-
so i don't think so (that was my original problem)
-
doughj3
I have myModel.objects.filter(...) and I'd also like to have one field from a model that this model foreign keys to
-
fUD joined the channel
-
fUD
Hello folks
-
zkanda
Oh got it. Wait a min.
-
limbera
order_no defaults to "" on the original save/instantiation
-
and then i try override it with the new one (generated based on the pk)
-
t3h9 has quit
-
colinbits has quit
-
carlosoliveira joined the channel
-
dump has quit
-
natea joined the channel
-
eVRiAL has quit
-
Hairy joined the channel
-
Hakim joined the channel
-
dhanush has quit
-
Hairy joined the channel
-
natea has quit
-
elbaschid joined the channel
-
carlosoliveira has quit
-
rpkilby joined the channel
-
fUD has quit
-
lorddaedra has quit
-
elbaschid has quit
-
b10n1k joined the channel
-
LogicaLInsanity joined the channel
-
busla joined the channel
-
melinath joined the channel
-
melinath has quit
-
LogicaLInsanity has quit
-
elbaschid joined the channel
-
elbaschid has quit
-
Guddu
I am trying to use django_ajax_select in a web app but i get an error
-
-
It complains of ImproperlyConfigured: settings.AJAX_LOOKUP_CHANNELS not configured correctly for 'TableItemLookUp'
-
joshlegs joined the channel
-
But I have configured as per the document. Could someone please help ?
-
jessamynsmith has quit
-
cybered2 has quit
-
cybered2 joined the channel
-
psykrsna joined the channel
-
bibhas joined the channel
-
joshlegs
does anyone have any suggestions on preferable python highlighters for sublime text 2 ?
-
snurfery joined the channel
-
nvm. seems it has one built in thats decent.
-
jonmorehouse joined the channel
-
kanja joined the channel
-
timkofu joined the channel
-
sayan joined the channel
-
pucko has quit
-
jrrickerson has quit
-
mun joined the channel
-
fdintino joined the channel
-
fdintino has left the channel
-
fdintino joined the channel
-
mun has left the channel
-
Hairy joined the channel
-
josephleon is now known as josephleon|away
-
dhanush joined the channel
-
Hairy has quit
-
chrismed joined the channel
-
donspaulding has quit
-
doughj3 has left the channel
-
Leeds joined the channel
-
aboudreault joined the channel
-
Hairy joined the channel
-
joshlegs has quit
-
busla has quit
-
fdintino has quit
-
garrypolley_ has quit
-
aboudreault joined the channel
-
busla joined the channel
-
SirRetnuh joined the channel
-
ohrstrom joined the channel
-
SuperLag has quit
-
naro joined the channel
-
pierre1_ joined the channel
-
Hairy joined the channel
-
Guddu
When using django_ajax_select I am getting an error as below
-
-
naro has quit
-
-
The error is __init__() got an unexpected keyword argument 'mimetype'
-
Does it has something to do with Django version 1.7.4 that i am using?
-
mun joined the channel
-
saju_m joined the channel
-
jarshwah has quit
-
I posted the complete question here. Appreciate if someone could help.
-
-
desophos joined the channel
-
snurfery has quit
-
ohrstrom has quit
-
dotz joined the channel
-
ohrstrom joined the channel
-
brts joined the channel
-
doza has quit
-
snurfery joined the channel
-
brockhaywood joined the channel
-
ohrstrom has quit