I suppose I should go through all the methods in the docs sometime...
FunkyBob
:)
govg has quit
ticketbot has quit
ticketbot joined the channel
naanman_ joined the channel
mattsll
I'm using the pylint-django plugin for pylint and am still getting no-member errors in all of my tests. Is that normal?
Koterpillar
mattsll: last I checked, it wasn't quite complete
Tomatosoup- has quit
mattsll
Koterpillar: So best bet is to just manually review those and ignore them if I know they're false positives?
Koterpillar
what's an example?
legostormtroopr joined the channel
de_dust joined the channel
mattsll
Koterpillar: https://paste.ee/p/5QPOb I import a model, generate an instance with django_dynamic_fixture, then reference it. I get no-member errors everywhere I use it. "Instance of 'list' has no 'id' member (no-member)"
I am a little confused as to why it's saying the instance is 'list'.
naanman_
would someone be able to help me with this stackO issue? It regards saving data to a separate model inside a modelform
mattsll: pylint-django can't see inside that very well
de_dust
i want to filter out all HousingApplications that have pets that aren't in HouseListing.allowed_pets
but im not sure how to write the query for it
Koterpillar
try .exclude(pet__in=F('listing__allowed_pets'))
de_dust
Koterpillar, you mean: applications = applications.exclude(pets__in=house.allowed_pets.values_list('id', flat=True))
de_dust has quit
Koterpillar
replace the call to values_list with .all()
and... yes
I thought house belonged to the application
mattsll
Koterpillar: You were right. One of my tests didn't actually need any dummy data. Just using order = Order() on that one made the errors go away.
Koterpillar: So back to my other question... just ignore them?
:-)
Koterpillar
mattsll: maybe add typing hints to d-d-f... and then make sure pylint uses them... and then realize there's only so much you can do in a weakly typed language
make sure you explain what's going on in a comment above that line...
out of interest, what's the generated query?
EyePulp has quit
Sonderblade has quit
de_dust has quit
de_dust joined the channel
de_dust
fkn internet lmao
the query is huge, theres heaps of other stuff going on
kodeart joined the channel
Sonderblade joined the channel
and yeah, i made "Pet.objects.exclude(pk__in=house.allowed_pets.all())" a variable so its clear now. no need for a comment
hipertracker joined the channel
Koterpillar
hmm... maybe make that a property on the House, then you can say pets__in=house.banned_pets
hutch34 has quit
AnInstanceOfMe has quit
lejedi76 has quit
renlo joined the channel
Karmavil
hi everybody. I've a question related to pip and python. I'm like amateur honestly (python/django/pip) I had used pip with python 3 but now on linux it's installed python 2 by default so, I notice that I just intalled pip for python 2 and there is pip for python 3 aout there. Should I uninstall python-pip and install python3-pip instead? I'm pretty sure I should but please tell me ehat you think
tdy2 joined the channel
Koterpillar
Karmavil: Distro?
Karmavil
Ubuntu 16.04
Koterpillar
Karmavil: use virtual environments (see virtualenvwrapper), it's probably packaged as python3-virtualenv or simply python-virtualenv; then you create yourself one with `mkvirtualenv -p $(which python3) myenv` and do work there
de_dust has quit
tdy1 has quit
Karmavil
Thanks Koterpillar. I was reading about that.. but the previous step is install pip.. that's why I askin
FunkyBob
virtualenv will bring pip with it
Karmavil
mmm sorry I know I need pip for virtualenv not for virtualrnwrapper. I will check
Thanks FunkyBob
Koterpillar
On Ubuntu, pythonX-virtualenv depends on pythonX-pip
dashdanw
hey guys
Karmavil
great. Thanknyou guys
dashdanw
if i have models.BooleanField(default=False) why does it still require me to set the value when I run a manual sql query?
Koterpillar has quit
Koterpillar joined the channel
AnInstanceOfMe joined the channel
FunkyBob
dashdanw: because the default is in Python, not SQL
re1_ has quit
tdy3 joined the channel
tdy2 has quit
restless_being has quit
de_dust joined the channel
dashdanw
FunkyBob: I guess I assumed that it would set the DEFAULT setting in postgres at least
woltman joined the channel
but that's coo'
also what's the best way to always create a subobject when generating another
FunkyBob
sub-object?
mucco_ has quit
dashdanw
so if i have user = User() and then i want user.profile_image to always be instantiated as a blank object, is there a way to do that?
FunkyBob
post-save signal
dashdanw
profile_image in that case would be an instance of some other Model named ProfileImage
mucco_ joined the channel
thanks FunkyBob
FunkyBob
assuming you just want to make sure one always exists
EyePulp joined the channel
naanman_ has quit
minichiello joined the channel
dodobrain
FunkyBob, so this happened after all my askbot shenanigans: forgot to add the django update to latest 1.8.x in requirements and the rest of the team was trying their hardest to figure out what is wrong
lawl.. thanks to insider info. i know that was a bug markusH fixed :D
de_dust has quit
the_rat joined the channel
FunkyBob
:)
glad it's working
minichiello has quit
tdy3 has quit
moldy
you really want to make sure everyone always runs with the same dependencies :)