#django

/

      • chasonchaffin joined the channel
      • bigblind has quit
      • fikka has quit
      • chasonchaffin has quit
      • Leeds joined the channel
      • lolidunno has quit
      • lolidunno joined the channel
      • chasonchaffin joined the channel
      • miz- joined the channel
      • jessamynsmith joined the channel
      • milardovich has quit
      • chasonchaffin has quit
      • chasonchaffin joined the channel
      • awagink joined the channel
      • bigblind joined the channel
      • fikka joined the channel
      • chasonchaffin has quit
      • milardovich joined the channel
      • bigblind has quit
      • bigblind joined the channel
      • nasusiro has quit
      • csotelo_at_work has quit
      • Lenz has quit
      • jessamynsmith has quit
      • cnk has quit
      • solomonix joined the channel
      • FunkyBob
        MarkusH: hey, is it possible to add my own state to track in migrations?
      • schinckel: you'll want in on this :)
      • schinckel
        What do you have in mind? Something about RLS in postgres? Or something else.
      • FunkyBob
        something for managing function/view versions
      • schinckel
        Oh cool.
      • FunkyBob
        allowing reverse painlessly*
      • schinckel
        I have my own solution, that is relatively painless.
      • However, if you add an argument to a function (or a column to a return-type when it's a table function) then reverse generally fails because you need to delete-then-create, rather than CREATE OR REPLACE.
      • r29v has quit
      • awagink
        hello
      • FunkyBob
        schinckel: I was planning on a migration op like CreateFunction('name', 'version')
      • so reversing it it would find the "old" state for the last time that function/view was created [by name] ...
      • it's mostly just formalising your pattern
      • schinckel
        Coolio.
      • chasonchaffin joined the channel
      • BPL joined the channel
      • knbk
        the migration state only really tracks the deconstructed fields, managers and meta options, and I don't think it's really viable to hook into the meta options.
      • hackvana
        What's the best practice on inline formsets? I'm working on an app that needs 13 inline formsets off a master ModelForm.
      • And django-oscar goes to special trouble: https://github.com/django-oscar/django-oscar/bl...
      • Lenz joined the channel
      • lavalamp has quit
      • All the .is_valid() and .save() stuff is a royal pain
      • yeukhon joined the channel
      • yeukhon has left the channel
      • Does Django not offer an out-of-box mechanism for registering inline formsets with a model form, such that the stock modelform code iterates over the inline formsets?
      • How does this happen when using inline formsets in the admin pages?
      • FunkyBob
        hackvana: sounds like you want superforms....
      • hackvana
        Oh?
      • Right, I'm onto it. Super suggestion!
      • FunkyBob
        3rd party app that lets you wrap multiple forms and formsets into a single entity
      • hackvana
        I'm getting a woody. I think I love you.
      • FunkyBob blushes
      • luisehk has quit
      • aossama has quit
      • BrandonBT has quit
      • jarshwah_ joined the channel
      • jarshwah has quit
      • a_djangooo has quit
      • Lenz has quit
      • joshbright joined the channel
      • danner joined the channel
      • wreed joined the channel
      • aossama joined the channel
      • awagink has quit
      • aossama has quit
      • av_ joined the channel
      • Ax3l joined the channel
      • kapil___ joined the channel
      • Fuyou has quit
      • Ax3l
        hi all - i have a foreign key access question from a django template. I have 4 models that are all related, 3 have a direct relationship and one does not. I have Stats, Player, Team and Divisions. Stats as an FK called Player, Player has an FK called Team and Divisions has an FK called team. In the template i can get a team name by doing {{ stats.player.team.team_name }}. How do I (or can I) access the divisions in the template?
      • joshbright has quit
      • polaris has quit
      • FunkyBob
        Ax3l: stats.player.team.division_set.all
      • iterate that
      • fikka has quit
      • aossama joined the channel
      • Ax3l
        FunkyBob: awesome. That gets me the queryset. is there an easy way to get the properties in there? for example stats.player.team.division_set.divison_name? I tried that but it does not return anything so i am guessing i am doing something wrong
      • FunkyBob
        Ax3l: well, you'd have to iterate it
      • since it's following a ForeignKey backwards, there could be 0 or more divisions related to that team
      • Ax3l
        FunkyBob: ahh right. that makes sense. Thanks!
      • FunkyBob
        so {% for division in .... %}
      • Ax3l
        FunkyBob: yeah that works. thanks a million!
      • aossama has quit
      • brainpro1 joined the channel
      • fikka joined the channel
      • brainproxy has quit
      • aossama joined the channel
      • Code4Dopamine
        hi all, i was wondering in terms of model field, is there a more graphical example of what it would be like? aside from the documentation here: https://docs.djangoproject.com/en/2.0/ref/model...
      • (also.. i've just started, and wondering do these effect get applied immediately after i refresh? or i have to do "makemigration" "migrate" "runserver" everytime changes are made?)
      • aossama has quit
      • BPL has quit
      • lobo_d_b joined the channel
      • mattmcc
        After changing models, you'll need to at least do makemigrations & migrate.
      • aossama joined the channel
      • detseg has quit
      • irisarce joined the channel
      • detseg joined the channel
      • irisarce
        Hi all, after some suggestions on saving and using logged in user uploaded images. Any suggestions for packaged and deployment?
      • *packages
      • wreed has quit
      • Ikoru has quit
      • Bryson has quit
      • chasonchaffin
        irisarce well Django can handle that just fine
      • irisarce as far as deployment goes, just make sure the uploaded images are uploaded to a folder served by apache or niginx or your static file server of choice
      • irisarce
        @chasonchaffin Thanks for the reply! I am new to deploying and deciding between a local vps, heroku, aws etc. Is it good practice to have the everything served from one machine?
      • fikka has quit
      • chasonchaffin
        not necessarily, it depends on what you're doing. having things on multiple servers is an advantage in a lot of ways (security, stability, etc) but a disadvantage in other (more points of failure, more complex infrastructure)
      • personally I usually launch on AWS EBS and serve user uploaded files from S3
      • mockie joined the channel
      • NomadJim has quit
      • detseg has quit
      • irisarce
        @chaseonchaffin would your database be on the same EBS machine?
      • NomadJim joined the channel
      • mcspud
        irisarce - we store all of our files on AWS S3, much the same way that chasonchaffin talked about
      • Basically none of our django servers have anything on them besides the application
      • The database sits on a seperate server
      • chasonchaffin
        no, its on the AWS relational database service
      • RDS
      • NomadJim has quit
      • irisarce
        @mcspud @chasonchaffin thank you both for the reply
      • lobo_d_b has quit
      • mgreen20 has quit
      • detseg joined the channel
      • NomadJim joined the channel
      • @mcspud @chasonchaffin any suggestions for reading regarding these topics?
      • fikka joined the channel
      • lobo_d_b joined the channel
      • chasonchaffin
        this is a bit old, but this guide isn't too bad: https://realpython.com/blog/python/deploying-a-...
      • newdimension joined the channel
      • irisarce
        @chasonchaffin in the header they have a py3 updated version. Thanks for the help! over and out!
      • notnull has quit
      • irisarce has quit
      • m1911 joined the channel
      • aossama has quit
      • sarariman has quit
      • detseg has quit
      • Code4Dopamine
        mattmcc: thanks, sorry for the late reply, so i guess one way to get a feel of what the fields look like would be to include all of it in a test to see?
      • mattmcc
        They don't really have a 'look'.
      • Form widgets do, though.
      • detseg joined the channel
      • dethos has quit