#django

/

      • randominternetus
        Thanks guys.
      • duoi
        jtiai, github?
      • jtiai
        duoi: Unfortunately proprietary stuff.
      • duoi
        fun
      • shangxiao
        schinckel: iirc you had a way of adding fields to a super-model that one might not have control over right? (eg if a base user model is in a 3rd party)
      • it was a discussion with mr uptick
      • aidan
      • i'm under the impression that a blog post would be required lol
      • zeus1 joined the channel
      • Fush has quit
      • Fush joined the channel
      • sayan joined the channel
      • tvm joined the channel
      • lavalamp joined the channel
      • obayemi joined the channel
      • schinckel
        shangxiao: not 100% sure I should encourage it
      • ;)
      • shangxiao
        lol
      • what did it involve? monkey patching?
      • jessamynsmith has quit
      • mattmcc
        It'd pretty much have to..
      • tvm has quit
      • sydbarret joined the channel
      • Xaldafax has quit
      • masaki joined the channel
      • cgfuh has quit
      • shangxiao
        oh dear then it's mid-project user model migration for us then
      • mattmcc
        Bah. Just quietly swap out auth_user with a DB view that joins in some other model.. :)
      • audioburn has quit
      • sydbarret
        I have a formset where it has checbox field in continuous rows.When user clicks it it should update that row in a table by changing another column as well. How can I acomplish that in django? Or do I need javascript?
      • mattmcc
        When you process the formset in your view, you can loop over the formset's forms and add additional behavior for each, just like you would for a regular form submission.
      • sydbarret
        mattmcc but this has to be after checking kind of instantly
      • Ruzzy
        I cloned my existing django project repo on a new machine and set up a postgres db for it, and installed its requirements into a new virtualenv. when I do a runserver (or a migrate) I get this https://dpaste.de/K14D
      • mattmcc
        Ah, do you mean changing one of the other form fields on the page?
      • eb0t
        hey when you sign up a user in django ..which model are passwords saved in
      • sydbarret
        mattmcc if you know ms access continous form, this will be similar
      • Ruzzy
        I suck at interpreting the exception but I leapt at googling installing psycopg2 properly on fedora
      • mattmcc
        I haven't used Access in probably 10 years..
      • sydbarret
      • so after user checks the checkbox the a_action should change from negative to OK for example
      • but it has to be in the checking event and not using a submit button
      • kyern has quit
      • Ruzzy
        installed some other packages believed to be dependencies of psycopg2. I can't seem to get a different result. Am I understanding the exception right?
      • newdimension
        eb0t: The hash of the password is saved in your user model
      • eb0t
        ah ok, it seems to be the set_password that does this i think
      • thanks newdimension, so im just glad to hear it is stored as a hash
      • kyern joined the channel
      • newdimension
        eb0t: The django team is good at implementing best practices so we don't have to worry about them too much
      • eb0t
        great stuff
      • mattmcc
        sydbarret: Can the user still change a_action with the box checked?
      • sydbarret has quit
      • lolidunno has quit
      • prabampm joined the channel
      • sandeepK joined the channel
      • astronavt
        does django do some black magic to prevent me from using try/except inside a view, or am i just doing something wrong
      • i assume the latter but one can never be too sure
      • mattmcc
        What are you trying, what isn't working?
      • kuter joined the channel
      • schinckel
        shangxiao: I used add_to_class (or contribute_to_class, or whatever), and then a custom AddField migration that also takes an app_label.
      • astronavt
        mattmcc no its PEBCAK
      • i figured it out
      • shangxiao
        schinckel: but no blog post on what you did? :)
      • schinckel: but cheers, i'll take a look
      • n0nam3 joined the channel
      • n000b joined the channel
      • eb0t
        hey what should i look into for site analytics..eg page views times, what gets clicked on etc for a django built site
      • i have heard that google analytics is meant to be ok, but not sure
      • then also not sure if i analyse the site from django or from the webserver
      • mattmcc
        Google Analytics is JS, so it's all driven by what the client sees.
      • And it's certainly an easy way to get started for free.
      • eb0t
        ah ok ..another site siad 30 percent of people block google though
      • but if its simple to implemtn then ill probably roll with that
      • mattmcc
        30 percent of people would still be using 'secret' as their password if it weren't for validation rules. I seriously doubt that many block tracking JS.
      • eb0t
        cool ...sounds like a good thing to start with ..thanks mattmcc
      • Ruzzy
        I'm still majorly confused about my psycopg2 problem. Does anyone have some time to help me diagnose it?
      • prabampm has quit
      • prabampm joined the channel
      • schinckel
        Soooo, it seems botbot.me will be shut down on november 5th. Does anyone have alternative ideas for logs?
      • Ruzzy: Try reinstalling psycopg2 after installing those dependencies?
      • Ruzzy
        schinckel: false alarm, schinckel
      • sorry, I just found a fix
      • schinckel: also, already tried that
      • turns out a --no-binary install of psycopg2 is the key
      • tm007 joined the channel
      • pathrocle joined the channel
      • foxmask
        bonjello
      • gcain joined the channel
      • schinckel
        foxmask: o/
      • mattmcc
        schinckel: Ick. Is the codebase open or being opened? And can we get a DB archive? That's a whole lot of history to lose.
      • tvm joined the channel
      • schinckel
        Oh, it's a Lincoln Loop project.
      • jtiai
        mattmcc: botbot has been open for a very long time. and channel admins can request log history.
      • mattmcc
        Ah. So the answers are yes and yes.
      • schinckel
        So, they are worried about GDPR. Which means DSF is likely to have similar concerns.
      • Oh, that blog post is only yesterday (or today...not sure what day it is the backwards part of the world)
      • mattmcc
        You'd think a TOS disclaimer in the motd would be enough for GDPR.
      • tdy has quit
      • schinckel
        Possibly.
      • pathrocle has quit
      • mattmcc
        A lot of the websites I visited while in Europe last month took that route. No fancy opt in/out options, just a single modal that says 'this is what we track for blah blah reasons'
      • pathrocle joined the channel
      • And then there's things like the LA Times that just geofence Europe entirely.
      • foxmask
        schinckel: o/
      • bob \o
      • roadie joined the channel
      • sydbarret joined the channel
      • sydbarret
        mattmcc I got disconnected . Did you have a chance to see the pic?
      • shangxiao has quit
      • pathrocle has quit
      • shangxiao joined the channel
      • SmileyChris has quit
      • mitaka joined the channel
      • geekodour08 joined the channel
      • pathrocle joined the channel
      • prabampm has quit
      • gcain
        I have a key/value table the holds various configuration settings for my app. I was wondering of there was a way of doing the form so that it self generates like other forms do from a model. At the moment I've just written each config field out manually but would like to do it the right way.
      • luxeve has quit
      • eb0t
        hmm ..i have cleared my browser data , cookies and history ..yet when i try and change password ..my form in django gives a drop down list which i dont want
      • any ideas
      • schinckel
        eb0t: You can set an attribute on the input field... autocomplete="off"
      • xliiv joined the channel
      • luxeve joined the channel
      • (in your template, probably, although depending upon your rendering you could have it in the form.Widget(attrs={'autocomplete': 'off'})
      • k_sze[work] has quit
      • eb0t
        ah ok nice
      • jtiai
        To my knowledge browsers are really terribly obeying autocomplete attribute.
      • adsworth joined the channel
      • eb0t
        so its autocomplete stuff.
      • mattmcc
        sydbarret: I'd asked if the user can still change a_action with the box checked.
      • sydbarret
        mattmcc ideally the row should requery and dissapear
      • dodobas joined the channel
      • dodobas
        yutro
      • mattmcc
        Is a_action directly editable at all?
      • sydbarret
        mattmcc no
      • mattmcc
        So yeah, I'd just remove it from the form.
      • sydbarret
        only the checkbox is the editable
      • mattmcc
        If it's always a derivative, you can set it when you save the form, no need to give the user a field they can't change.
      • UncleVasya joined the channel
      • sydbarret
        mattmcc my question is how i will update the model by checking the checkbox.
      • mattmcc that is basically a sql stament in Access
      • mattmcc
        That's what I was talking about earlier. You can loop over the formset's forms and save extra values at that time, based on what was submitted.
      • roadie has quit
      • sydbarret
        you mean checking all the checked ones?
      • looping through the checked ones and update the model based on their ids right?
      • roadie joined the channel
      • mattmcc
        sydbarret: Something like http://dpaste.com/18K68FF
      • prabampm joined the channel
      • shangxiao has quit
      • sydbarret
        mattmcc that goes in the template?
      • eb0t