#django

/

      • knbk
      • diverdude
        hi, when using the cookiecutter, what impact does the input GH repo have? I mean what difference does it make if i use one GH repo over another?
      • kurashu89 has quit
      • nderCova
        knbk: thanks! Fantastic!
      • justanr joined the channel
      • nderCova has quit
      • danner joined the channel
      • moldy
        diverdude: the GH repo contains the template
      • diverdude: so it can potentially change everything, depends on the differences between the two repos
      • diverdude
        moldy: right ok. Because in the docs i have seen them sometimes refer to some repo called audrey and othertimes to one called pydanny....im am unsure which one to use
      • jmill joined the channel
      • fission6 has quit
      • XofP joined the channel
      • iamkhush joined the channel
      • backnforth joined the channel
      • moldy:
      • moldy: are you there?
      • jmill has quit
      • shangxiao
        diverdude: in the docs?
      • diverdude
        shangxiao: yeah
      • shangxiao
        the django docs don't mention cookiecutters
      • anddam
        vlt, FunkyBob: ok but what's the guideline for having upper case constants?
      • diverdude
        shangxiao: no the cookiecutter docs
      • shangxiao
        diverdude: so not really a django question?
      • anddam: upper case letters
      • diverdude
        shangxiao: im sure there are a lot of cookiecutter users in here...it is after all a tool for django
      • rando305 has quit
      • shangxiao
        ask away if you like i'm not stopping you
      • csotelo_at_work joined the channel
      • it's not a tool for django … it's a project template tool for anything
      • XofP has quit
      • anddam: oh are you asking why are constants uppercase?
      • moldy
        diverdude: you will have to look at the differences, or just try
      • fission6 joined the channel
      • rando305 joined the channel
      • at first glance, pydanny seems to be the more active repo
      • rando305
        knbk, thanks. I still get '('A01157',)' not found. It seems odd to me that it is showing up as a string in a tuple. But I don't understand regex well yet.
      • milardovich joined the channel
      • lacrymology has quit
      • ycon_ joined the channel
      • shangxiao, Thanks for the suggestion. I was trying one, but I didn't know how it would handle the <parameter> issue. How would I test a url pattern?
      • shangxiao
        in a regex tester
      • anddam
        shangxiao: yea, it's explicitly the opposite of pep8
      • shangxiao
        rando305: so i've just used something like regex101.com
      • ams__ joined the channel
      • anddam
        btw any hint on a template beautifier? some HTML one that is aware of django template tags
      • shangxiao
        there are a few out there
      • rando305
        shangxiao, I'll try that. I was confused at how it would handle the P(agency_id) part
      • knbk
        anddam: pep8 says upper case with underscores for constants: https://www.python.org/dev/peps/pep-0008/#const...
      • shangxiao
        not only is it pep8 but it's probably the only thing folks can agree on across most languages
      • Ahuj has quit
      • lavalamp joined the channel
      • well the ones i've worked with xD
      • milardovich has quit
      • rando305: why be confused? just paste it in there :)
      • afaik capturing groups aren't just a python thing
      • rando305: in any case if you're still having issues you'll need to dpaste.de your _current_ code and tracebacks
      • otherwise we'd just be guessing
      • greg_f has quit
      • rando305 has quit
      • felixx has quit
      • ticketbot joined the channel
      • iamkhush has quit
      • jas02 joined the channel
      • anddam
        knbk: ah ok I was checking globals, thanks for pointing that out
      • is there a builtin filter for capping an integer?
      • amcorreia
        Have any pro/con using py.test ?
      • anddam
        I have some_value and I want to put (some_value if some_value <= 100 else 100) in the rendered page
      • moldy
        {% if value <= 100 %}{{ value }}{% else %}100{% endif %}
      • milardovich joined the channel
      • amcorreia: it's nice.
      • amcorreia
        moldy: I can't find what is the difference between default django test and py.test
      • moldy
        amcorreia: check the pytest docs. if you want to use pytest with django, you will also want the pytest-django plugin.
      • lacrymology joined the channel
      • kuter has quit
      • milardovich has quit
      • jas02 has quit
      • jas02 joined the channel
      • jmill joined the channel
      • ycon_ joined the channel
      • milardovich joined the channel
      • jonesnc has quit
      • Snaffu joined the channel
      • RCStef has quit
      • RCStef joined the channel
      • bkxd joined the channel
      • ycon_ has quit
      • amcorreia
        moldy: I'm not sure whether I want... I just see py.test in an project with functional tests...then I start to lookup at py.test..
      • milardovich has quit
      • idontneedanick joined the channel
      • realnot has quit
      • bkxd has quit
      • shangxiao has quit
      • FunkyBot has quit
      • idontneedanick has quit
      • jas02 has quit
      • encod3 has quit
      • jonesnc joined the channel
      • Diemuzi has quit
      • HRJ_ joined the channel
      • HRJ_
        Hi, How make log details for django password reset?
      • Something similar to signals for user_login, does we have for password reset?
      • idontneedanick joined the channel
      • raijin has quit
      • vector_ joined the channel
      • milardovich joined the channel
      • nix64bit joined the channel
      • nix64bit has quit
      • jessamynsmith joined the channel
      • ozcanesen joined the channel
      • vector_
        Hello all, I have a question about using annotate. I have a situation where I want to create a computed column with annotate that is the number of hours between a date field on the object and the current date and time.. I'm not really sure how to start.. has anyone done anything similar to this before?
      • milardovich has quit
      • slav0nic has quit
      • __marco has quit
      • polaris joined the channel
      • npgm joined the channel
      • tlaxkit joined the channel
      • raijin joined the channel
      • raijin has quit
      • raijin joined the channel
      • lacrymology has quit
      • the_rat joined the channel
      • greg_f joined the channel
      • Debnet has quit
      • the_rat has quit
      • cubillosxy_py joined the channel
      • danner joined the channel
      • hamub joined the channel
      • cubillosxy_py
        hello, I have this error AttributeError: 'RequestFactory' object has no attribute 'META' , i dont know how solve this, anyone know , https://dpaste.de/4xDA
      • ozcanesen has quit
      • jmill has quit
      • RCStef has quit
      • dang`r`us
        cubillosxy_py, it looks like you're treating a request factory like a request
      • check https://docs.djangoproject.com/en/1.11/topics/t... for an example of using a request factory to create a request
      • kanja has quit
      • jdo_dk
        Is there any strange behaviours with using if inside django template? I have this code: <li{% if membership.company.pk == request.session.company %} class="active"{% else %} class="inactive"{% endif %}>{{membership.company.pk}} - {{request.session.company}} - {{membership.company|title}}</li>
      • And it prints 1 - 1 - CompanyName, but the class is inactive and not active as expected. :(
      • jmill joined the channel
      • thegreenhundred joined the channel
      • cubillosxy_py
        dang`r`us , humm but this was working in my old 1.9 version , i am updating t0 1.11
      • ycon_ joined the channel
      • _main_ joined the channel
      • dang`r`us
        cubillosxy_py, maybe because 1.9 wasn't using the request object in this scenario at all. If you're curious you can diff 1.9's context_processors.py against 1.11
      • or just fix your code
      • _main_ has quit
      • actually it's also possible wkhtml has changed
      • cubillosxy_py
        dang`r`us>ok, i'll try wirh request =None
      • dang`r`us
        either way, a request factory is a thing that creates requests
      • cubillosxy_py, None also has no attribute 'META'
      • cubillosxy_py
        dang`r`us : O.o , then what do i do?