#django

/

      • bsl10 has quit
      • shredding joined the channel
      • the_rat has quit
      • bochecha has quit
      • CrowX- has quit
      • shredding has quit
      • Ruzzy
        already asked on webdev but it's not overly active so I'm repeating myself here.
      • the powers that be want a carousel on the homepage, with left and right arrows, and page selection buttons at the bottom
      • hfp has left the channel
      • also it needs to have a fade animation instead of the normal sliding animation. also width needs to fill the viewport, height fixed
      • I've already found a solution that doesthe width and height thing which I like, but no buttons or pages or fade
      • FunkyBob
        tehre's so many out there
      • noobstrap joined the channel
      • jeffaustin81 has quit
      • Ruzzy: the fade you can do using a css transition on opacity
      • timb07 joined the channel
      • Koterpillar
        what's the DRYest way to do this? https://dpaste.de/yGXO
      • mattmcc
        Ruzzy: I think we're currently using owlcarousel, but yeah, there's tons of them out there.
      • Koterpillar
        (in short: get_or_create, but if the record exists, it should be updated with **defaults)
      • jas02 joined the channel
      • FunkyBob
      • create_or_update isn't there?
      • Koterpillar
        yes, that's exactly it! thanks
      • 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
      • Koterpillar
        mattsll: I'm guessing django_dynamic_fixture is the problem
      • de_dust
        i have an issue https://dpaste.de/bGEw
      • Koterpillar
        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
      • de_dust joined the channel
      • de_dust
        sorry
      • computer shat itself, had to reboot
      • Koterpillar
        de_dust: see topic for logs
      • de_dust
        yep, checking now
      • SecondForm_Glenn has quit
      • dodobrain joined the channel
      • noobstrap has quit
      • timb07
        Hey yall. I've just asked (and answered myself) a question on SO; can anyone offer feedback or a better solution? http://stackoverflow.com/questions/40835222/dis...
      • de_dust
        Koterpillar, that doesnt work
      • Koterpillar
        define doesn't work
      • de_dust
        it has to exclude HousingApplications where there are HousingApplication.pets that AREN'T in HouseListing.allowed_pets
      • Koterpillar
        ah!
      • de_dust
        so if the HousingApplication has a dog & a cat, but the HouseListing has a bird, then it should exclude it
      • but if the HousingApplication had a bird, then it should show up
      • just a bird *
      • audio has quit
      • roflmyeggo joined the channel
      • Koterpillar
        possibly...
      • applications = applications.exclude(pets__in=Pet.objects.exclude(pk__in=house.allowed_pets.all()))
      • I don't like that though
      • Karmavil joined the channel
      • de_dust
        hmm
      • Koterpillar
        https://code.djangoproject.com/ticket/6065 was about adding notin, and closed with "see exclude"
      • but I don't think it will work here
      • de_dust
        that works perfectly, thanks
      • Koterpillar
        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 :)
      • pip-tools helps
      • M|6 joined the channel
      • the_rat has quit