#django

/

      • sandwichheat has quit
      • emcfins joined the channel
      • Haudegen joined the channel
      • emcfins has quit
      • emcfins joined the channel
      • basix joined the channel
      • OtherAllan joined the channel
      • NoOova has quit
      • jax
        jnns: nothing to be found there.
      • pembo13 has quit
      • jnns
        jax: so you get an exception that the template in question could not be found, right? The traceback should list the lookup directories, did you check whether they're correct?
      • jax
        no, it is using the template from the package installed by pip
      • not the one i've put in place to override
      • kunalg joined the channel
      • robattila256 has quit
      • wili has quit
      • grokpot
        Hello all. Can someone explain using {{field.value}} in templates to me? The documentation just says "{{ field.value }} The value of the field" but that doesn't explain much. Im using it for a TypedMultipleChoiceField with coerce=int but it's returning a list of strings
      • DeepThoughts has quit
      • jnns
        jax: in case you're not just flipping DEBUG the template may actually be missing on your production server
      • AndrewMcC joined the channel
      • jax
        hm. odd.
      • the template is there. if i do: from django.template.loader import get_template
      • t = get_template('crispy_forms_foundation/foundation-5/layout/inline_field.html'); t.origin.name
      • it shows the correct path to the one that should be overriding...
      • rtb has quit
      • ah crap :D
      • jnns
        jax: did you find the error?
      • jax
        sorry, i by accident overwrote the template in site-packages instead of the one in the project. so commit didn't upload it :D
      • had both open, just edited the wrong one. sorry.
      • robvdl joined the channel
      • retailify has quit
      • ariel_17 has quit
      • Stranger6667 has quit
      • basix has quit
      • NoOova joined the channel
      • jnns
        jax: glad you found it
      • nurulwai has quit
      • Quitta joined the channel
      • nk1 has quit
      • jo_
        Is there a way to aggregate boolean values in Postgres?
      • Other than Count()? I can't seem to use Max/Sum without casting, and I'm not sure how to do that in the ORM.
      • bollullera joined the channel
      • roflmyeggo joined the channel
      • Donitz has quit
      • sashav has quit
      • Donitzo joined the channel
      • kriwil joined the channel
      • Donitzo has quit
      • Quitta has quit
      • Donitzo joined the channel
      • TheTemplar joined the channel
      • grokpot
        jo_: You can probably do something like aggregate over a Case(When())
      • jessamynsmith has quit
      • aroncero has quit
      • jax has quit
      • for example: boolcount=Sum(Case(when(myfield=True, then=1), output_field=models.IntegerField()))
      • jwhitmore_ has quit
      • ilhami
        I hate Django + nginx.
      • jwhitmore has quit
      • jo_
        grokpot: What if I'm stuck with 1.7? :(
      • grokpot
        but.. i'd probably sacrifice the performance for a queryset .count()
      • bollullera has left the channel
      • jo_
        Unfortunately, count is including cases where my_field=False.
      • So count is always nonzero.
      • grokpot
        I would definitely push to upgrade to 1.8 if you're stuck on 1.7
      • jo_
        I had in annotate is_leaf=Count('pcm__is_leaf'), but again, that's always nonzero.
      • I'll bring it up at the next spring. Our PM won't like it.
      • microdex2 has quit
      • *sprint
      • chowmeined has quit
      • grokpot
        jo_: your count should read `pcm__is_leaf=True`
      • Bash4 joined the channel
      • Bash4 has quit
      • thinkt4nk has quit
      • fluxbot000 has quit
      • fluxbot000 joined the channel
      • jo_
        grokpot: ...filter(stuff).annotate(is_leaf=Count('pcm__is_leaf=True'))?
      • vobiscum_ has quit
      • banym has quit
      • grokpot
        jo_: no sorry, one min
      • Bash4 joined the channel
      • srj55 has quit
      • TheJoey
        ilhami: You don't have nginx speaking directly to Django, do you?
      • Stranger6667 joined the channel
      • theslow1_ joined the channel
      • onizo has quit
      • Guest40233 joined the channel
      • ejb joined the channel
      • ilhami
        TheJoey: I don't know if I have.. I used the digitalocean default django package
      • and the default django project was setup. I cloned my own project from bitbucket and tried to change the init file
      • gunicorn init
      • Guest31 joined the channel
      • Now I get 502 - Bad gateway
      • grokpot
        jo_: Without django 1.8 I'd probably just do a filter(is_leaf=True).count()
      • jo_: but make sure to re-use your queryset
      • theslow1 has quit
      • Bash4 has quit
      • Bash4 joined the channel
      • Stranger6667 has quit
      • sandwichheat joined the channel
      • TheJoey
        ilhami: Ah, afraid I'm not familiar with digitalocean. But that wouldn't be talking directly to Django, so at least that's good. It sounds like gunicorn is acting as the WSGI server, and that may be where your problem lies.
      • acangiani has quit
      • jo_
        grokpot: I have to pass thsi queryset to a serializer.
      • And I have to do this for each pcm object.
      • roflmyeggo has quit
      • holler joined the channel
      • fluxbot000 has quit
      • ilhami
        TheJoey: no idea.
      • jayjj joined the channel
      • I am just tired of this. :P PHP was much easier to deploy
      • jayjj
        yeah djano is terrible with forms
      • i am thinking about going with mean
      • ilhami
        jayjj: I just use it as an API
      • sandwichheat has quit
      • DeepThoughts joined the channel
      • TheJoey
        ilhami: PHP in itself doesn't have a deployment mechanism. Nor does Django dictate (or prefer) a particular deployment solution.
      • Softeisbieger has quit
      • jayjj
        it was a bad idea to learn it. i think i wasted months trying to learn it.
      • ilhami
        ahahaha
      • I used a week or so
      • :D
      • jayjj
        there's really no good documentation or courses that cover forms.
      • fluxbot000 joined the channel
      • whaack joined the channel
      • ilhami
        too bad.
      • TheJoey
        jayjj: What would you like to see added to the tutorial and official Django docs?
      • grokpot
        jo_: I'd suggest Q objects but I don't know your exactly situation so I'm sorry
      • pwrentch has quit
      • jo_
        No worries. Thanks for th ehelp.
      • spgingra_ joined the channel
      • TheJoey
        jayjj: There is also the DjangoGirls tutorial, which is highly regarded.
      • jayjj
        better form documentation with how-tos for form validation
      • i went through that.
      • KlausedSource_ has quit
      • pupil has quit
      • vobiscum joined the channel
      • i went through the official documentation. i am a noob, i'll admit but it isn't for a lack of trying.
      • i am also learning via TDD Django book
      • ilhami
        FREAKING GATEWAY :D
      • Why are you BAD? :D
      • grokpot
        ilhami: check out Heroku. Deployment is super easy with Django
      • djosh has quit
      • ilhami
        grokpot: I have a DO VPS
      • eperzhand joined the channel
      • ranguli_ joined the channel
      • TheJoey
        ilhami: You should check to see if there are logs being generated by gunicorn. I don't know where digitalocean would be putting them by default.
      • grokpot
        ilhami: scrap it :)
      • spgingras has quit
      • jnns has quit
      • spgingra_ has quit