#django

/

      • Haudegen has quit
      • jhfisc has quit
      • bullicon joined the channel
      • andyhoang2 joined the channel
      • busla joined the channel
      • busla has quit
      • Combined2857 joined the channel
      • bullicon has quit
      • andyhoang2 has quit
      • Leeds joined the channel
      • sepow has quit
      • djapo
        theology: In what use case would you want user models to be deleted so soon after creation?
      • bullicon joined the channel
      • jessamynsmith joined the channel
      • aossama has quit
      • bullicon has quit
      • theology
        djapo, chat app
      • sphrak
        hello djapo o/
      • djapo
        sphrak: hello o/
      • busla joined the channel
      • busla has quit
      • jhfisc joined the channel
      • pm2 joined the channel
      • exaroth joined the channel
      • sphrak
        what you up to djapo? :D
      • aossama joined the channel
      • djapo
        sphrak: im trying out docker secrets, im trying to get my entry script to read in my postgres settings from /run/secrets/ so that i can connect to my db
      • jhfisc has quit
      • im not shure if i should do a one line fix where i load the secrets into env var, or go thru a few files and read in the files into python vars
      • one is easy but lazy and defeats the reason for using secrets, the other is more secured but also more work
      • sphrak
        djapo: hmm I have never used docker, but it sounds like you'd want the latter one anyways even tho it takes little more time to setup
      • jhfisc joined the channel
      • I never grasped how to think about docker, is it a VM or is it more like a snap?
      • moldy
        only you can decide
      • it depends on how big the risk of using env vars in your specific situation is
      • theology
        only you can prevent forest fires
      • moldy
        it may be very big or, or it may be almost zero
      • djapo
        sphrak: its like a chroot
      • jhfisc has quit
      • moldy
        personally, i don't think docker secrets are a great solution, but it all depends
      • ycon_ joined the channel
      • sphrak
        djapo: so like lxc?
      • djapo
        moldy: what are the drawbacks you see
      • sphrak: yes, infact you can use lxc as a driver for docker
      • moldy
        it's a bit ironic that the official docker secrets tutotial teaches practices that are worse than env vars, security-wise...
      • djapo: tied to docker, not battle-tested
      • tsukasa_ has quit
      • sphrak
        djapo: hmm imma look into that then, seems cool
      • theology
        whats the difference between models.DateTimeField(default=timezone.now()) and models.DateTimeField(auto_now_add=True) ?
      • djapo
        moldy: is docker not battle tested or the feature, well its always the early adapters that battle test new features.
      • moldy
        djapo: docker secrets is especially new
      • djapo
        theology: if i remember correctly one is done by python and the other by the db
      • moldy
        don't use stuff because it's cool
      • jessamynsmith has quit
      • jhfisc joined the channel
      • do *you* have a *problem* with env vars?
      • StvnW has quit
      • djapo
        moldy: no, but i don't like stuff showing up in logs so that other devs see stuff they shouldn't need to see lulz
      • moldy
        theology: default=timezone.now() won't do what you want. default=timezone.now will.
      • djapo: so you must judge wether that is a big enough problem in your case to justify use of docker-secrets or whatever
      • theology
        moldy, oops, yes what is the diff between the two with now not now()
      • eperzhand has quit
      • moldy
        theology: "Note that the current date is always used; it’s not just a default value that you can override."
      • eperzhand joined the channel
      • jhfisc has quit
      • jhfisc joined the channel
      • StvnW joined the channel
      • sphrak
        are there any tricks to get better at understanding source code, other than reading source code?
      • moldy
        reading it is the main trick
      • tourdownunder has quit
      • slower is faster
      • milardovich joined the channel
      • busla joined the channel
      • sphrak
        moldy: so no then?
      • jhfisc has quit
      • mucco has quit
      • moldy
        sphrak: read a lot, write a lot. take your time to understand things. research everything you don't understand.
      • jessamynsmith joined the channel
      • busla has quit
      • eventually, learn what you do need to understand and what you can stay ignorant about
      • jhfisc joined the channel
      • eperzhand has quit
      • sphrak
        moldy: that makes sense, how would one tackle scenarios where one get stuck? and research seems fruitless
      • moldy
        sphrak: depends on the scenario. but in general: ask for help? skip it and come back to it later?
      • djapo
        sphrak: know how you are stuck, ask if anyone else has been stuck there before? how did they get out? if all that fails, make a way out
      • milardovich has quit
      • jessamynsmith has quit
      • sphrak
        moldy, djapo hmm right.. I feel if I cant solve a problem right away I get stuck entirely meaning no progression at all, its hard for me to just "do something else" meanwhile if you get what I mean
      • djapo
        sphrak: roll back your changes and try to do it a different way, if you get stuck in the same place ask the same questions
      • pm2
        I have a manytomany field on Model A pointing to Model B. In the admin site, I'd like users who edit A objects to be able to edit B objects as inlines. I'd override the admin behavior to call get_or_create for each B object, using the values entered by the user. What's the best way to approach this? I've tried specifying a custom ModelForm for model B in the TabularInline class
      • jessamynsmith joined the channel
      • but the admin site keeps getting upset that I'm trying to provide a form for the "wrong" model. Will I need to override the views entirely? Or is there a more straightforward option?
      • SamSagaZ_ joined the channel
      • sphrak
        djapo: yes, im gonna try to write line by line what each thing do .. maybe that will help me :)
      • andyhoang2 joined the channel
      • schinckel
        At some point, shoehorning the admin into your operations console becomes more work than writing a custom ops console.
      • jhfisc has quit
      • tsukasa_ joined the channel
      • andyhoang2 has quit
      • pm2
        Maybe, though I was thinking this would be a semi common use case. Basically, I'd like the user to just specify the data they want in model B for a given model A record, without having to worry about managing model B records. Basically, abstract away the fact that they're dealing with model B records at all.
      • aossama has quit
      • busla joined the channel
      • aossama joined the channel
      • busla has quit
      • Troy1 joined the channel
      • andyhoang2 joined the channel
      • pm2 has quit
      • Debnet has quit
      • jtiai^ joined the channel
      • cellofellow has quit
      • clodal joined the channel
      • delgiudices joined the channel
      • jtiai^ has quit
      • tsukasa_ has quit
      • lolidunno has quit
      • lolidunno joined the channel
      • tsukasa_ joined the channel
      • spacecadetbrown joined the channel
      • zivester joined the channel
      • jhfisc joined the channel
      • tsukasa_ has quit
      • spacecadetbrown has quit
      • jhfisc has quit
      • busla joined the channel
      • jessamynsmith has quit
      • busla has quit
      • jhfisc joined the channel
      • jhfisc has quit
      • tsukasa_ joined the channel
      • jhfisc joined the channel
      • inchidi joined the channel
      • tsukasa_ has quit
      • blackfry888 joined the channel
      • tourdownunder joined the channel
      • tsukasa_ joined the channel
      • jhfisc has quit
      • jessamynsmith joined the channel
      • inchidi
        may i advertising django group at telegram here?
      • jessamynsmith has quit
      • jessamyn_ joined the channel
      • jessamyn_ has quit
      • jessamynsmith joined the channel
      • jessamynsmith has quit
      • jessamyn_ joined the channel
      • if you are telegram user, we have new django user group at telegram https://t.me/djangogroup
      • Huitzi has quit
      • aossama has quit
      • jhfisc joined the channel
      • aossama joined the channel
      • busla joined the channel