what is the best way to mock out a call to a model's get method? (i.e. model.objects.get(id=1))
dirn_ has quit
FunkyBob
bmonty: in tests, I assume you mean?
have you looked at factory-boy ?
neurosnap joined the channel
bmonty
FunkyBob: Yes for testing, no I haven't seen factory boy...looking now
loic84 joined the channel
FunkyBob
bmonty: you'll love it :)
factory-boy and Mock
NomadJim has quit
NomadJim joined the channel
bkeating_ has quit
T150 joined the channel
kbambz has quit
kbambz joined the channel
SpinningWheels has quit
harumph has quit
wilywonka has quit
wilywonka joined the channel
MMcKay has quit
T150 has left the channel
jMyles joined the channel
loic84 has quit
moneydouble joined the channel
ArcTanSusan joined the channel
Siecje has quit
ghostlines joined the channel
thesheff17 has quit
Auv has quit
ArcTanSusan has quit
Auv joined the channel
wilywonka has quit
T150 joined the channel
Reflow has quit
bmonty has quit
moneydouble has quit
Sarcasm joined the channel
T150
Installed django 2.7.6 32 bit sucessfully
moneydouble joined the channel
Then did a startproject and my settings.py file was MUCH shorter than normal.
Has there been a change in the minimum settings.py created by startproject?
Make that v1.6 :)
ghostlines
yeah I notices that the settings file is much shorter now
mattmcc
T150: Yes, a number of settings were removed from the boilerplate file.
FunkyBob
T150: yeah, 1.6's default settings is far more practical and short
Fuyou
parsed_data = {StringIO} < O.o what does it supposed to mean
FunkyBob
Fuyou: that appears to be creating a set
Fuyou
from StringIO class?
FunkyBob
yeah, odd...
but out of context, who can say...
JainAmber has quit
Fuyou
In context it should be creating empty dict
I don't know where StringIO came
FunkyBob
neither do I
Fuyou
Could 2to3 put it there???
Yeah, why it would
the_rat has quit
FunkyBob
no idea... you've not told us even where it is
snurfery has quit
Fuyou
well, that is appeared in one of my views. Just used it and get error
mmcardle joined the channel
StringIO was used there, but then I 2to3
ed it and replaced later it with BytesIO
somniac joined the channel
gus_uy has quit
I quite sure I didn't put in my dict
some weird shit is going on )))
FunkyBob
people still use 2t3?
I just use six
mmcardle has quit
sedeki has quit
Fuyou
Well, I wanted more diving into py3 so I thought it's okay
sedeki joined the channel
sgambino has quit
NomadJim_ joined the channel
FunkyBob
Fuyou: the most common approach I see is to write Py2 or Py3, then use six to make it compatible with the other
NomadJim has quit
sedeki has quit
T150
Understood v1.6 default settings.py has been shortened. Thank you.
Mine ends abruptly at STATIC_URL = '/static/'
Can someone do a quick startproject test and check for that?
It just seems way short and I'd like to know if it's like that for others.
Fuyou
FunkyBob, ok, thx for info
ArcTanSusan joined the channel
FunkyBob
T150: yep, looks right to me
82 line
s
tiktuk has quit
kbambz has quit
tiktuk joined the channel
T150
82 lines. Yes, exactly what I'm getting. Thanks for checking!
aeikenberry has quit
mattmcc
T150: It's short on purpose. It's not that settings have gone away, it's that their defaults are adequate, so they don't need to be there.
There have always been a number of settings that never showed up in the boilerplate settings.py file.
Z_A_M has quit
snurfery joined the channel
kaakku joined the channel
FunkyBob
there's also a number of now-default values that weren't before
and I'm so glad they are now :)
bradfordtoney has quit
leandroa has quit
garet joined the channel
T150
Thanks Matt & Bob. Guess I didn't get the memo when they shortened it.
After years of seeing the old default, the new one look so chopped off.
FunkyBob
it's a good idea to read the 1.6 release notes, there's some big stuff in tehre
NomadJim_ is now known as NomadJim
hmm...
T150 scurrying away to RTFM :)
FunkyBob is learning to WTFM :)
sedeki joined the channel
AmberJ joined the channel
AmberJ
Hello
If an app called "x" has a model called "y", what's the name of corresponding table when model "y" is stored in database?
FunkyBob
x_y
AmberJ
I guess I read somewhere in docs that the table is named as x_y (?)
Thanks FunkyBob!
voidus joined the channel
voidus is now known as void
tiktuk has quit
tiktuk joined the channel
sedeki has quit
void has quit
FunkyBob
hmm.. the more I learn about using reST/sphinx... the more I think I'm missing
mmcardle joined the channel
Siecje joined the channel
or maybe it's just RTDs style
snurfery has quit
mmcardle has quit
epicowl joined the channel
neurosnap has quit
sedeki joined the channel
sedeki has quit
incitonetworks has quit
sayan joined the channel
cellofellow has quit
bradfordtoney joined the channel
AmberJ
Django automatically adds a primary key field "id" to all models automatically...
When I specify a foreign key relationship, the relationship is to "id" field of the table... What if I want the relationship to point to some other field which isn't primary key but is guaranteed to be unique?
Z_A_M joined the channel
Siecje has left the channel
FunkyBob
AmberJ: then I'd question your understanding of relations :P
AmberJ: nah, there's a way, mentined in the docs, to specify which field it relates to