#django

/

      • dhanush joined the channel
      • saurabhjha joined the channel
      • codeme joined the channel
      • jaddison joined the channel
      • dukez
        moritz_s: ok. Hmm, what way would you recommend? it's gonna be a REST API, so, split the non model and model there?
      • moritz_s
        dukez: just write as if you were not using django, i.e. use some rest client lib and use that in some kind of DeviceConnector class
      • msg555 joined the channel
      • codeme has quit
      • dukez
        moritz_s: so let's say I have a django model for configuring a remote device, then I could just add a "virtual" field on the API side to that serializer that exposes the hardware status?
      • codeme joined the channel
      • sayan joined the channel
      • codeme has quit
      • noregret
        https://dpaste.de/hXGD - i want to place those two forms in a single template, with mixing some fields together, is there a way other than manually unpacking the fields?
      • moritz_s
        dukez: I'm not sure what you mean. Essentially you should be able to do something like "device.get_status()" where device is not an Model instance but an instance of a class you wrote
      • pupil joined the channel
      • And then you could have something like "MyDeviceOptionsModel.get_device()"
      • douedd has quit
      • noregret
        I simply have this, https://dpaste.de/4wbb
      • space-wizard joined the channel
      • moritz_s
        noregret: manually specifying all your fields doesn't actually accomplish anything. A form prefix is probably what you want.
      • douedd joined the channel
      • subho has quit
      • noregret
        moritz_s: why would I need a prefix? all fields are different
      • moritz_s: also, i don't think you understood my qestion
      • moritz_s
        noregret: Well they are for now, I wouldn't rely on that.
      • noregret: That's possible. So why exactly do you have to manually specifiy all fields?
      • space-wizard has quit
      • noregret
        moritz_s: 'fields' is required to be there
      • cb_ein joined the channel
      • dukez
        moritz_s: thanks, I'll just add a rest-framework view that proxies the hardware and tie it at the API layer
      • noregret
        moritz_s: "django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited"
      • moritz_s
        noregret: right, but I still don't get how that has anything to do with your question
      • noregret
        moritz_s: you asked why i am specifiying the fields..
      • saurabhjha has quit
      • saurabhjha joined the channel
      • geetar joined the channel
      • moritz_s
        noregret: For me it seemed like your "solution" to your problem that I apparently haven't completely grasped yet was to specify all fields. I just wanted to make clear that that has nothing to do with using multiple forms in a template
      • space-wizard joined the channel
      • noregret
        mrhanky: my question is, i need two fields from the lower form to appear first then all fields of the first form then all fields of the second. that's what i meant by mixing fields. so i'm asking if it's possible without manually unpacking the fields and dealing with errors and the rest of the hassle
      • moritz_s: using 'fields' is not my solution ofc, i was just showing what i have
      • imack has quit
      • moritz_s
        noregret: ah ok, now I get it. Since you're using the bootstrap template tag I don't think there is an easier solution than to specify them manually
      • noregret
        moritz_s: so you're saying that {% bootstrap_field field %} will take care of that?
      • vaibhav10jain
        @noregret manaully unpacking is the way
      • moritz_s
        noregret: I don't know what those tags do, so I can't tell you. You have to look into the docs of the package that provides those
      • noregret
        vaibhav10jain: using https://docs.djangoproject.com/en/1.9/topics/fo... for around 50 fields is tedious..
      • saurabhjha has quit
      • grumpi has quit
      • zkanda joined the channel
      • shangxiao has quit
      • moritz_s
        noregret: you could pass a variable called "fields" in the context that contains all the fields in the correct order and then just do {% for field in fields %}do stuff{% endfor %}
      • shangxiao joined the channel
      • noregret
        moritz_s: "fields" being a list?
      • moritz_s
        noregret: a list of bound form fields to be exact
      • jrist joined the channel
      • hapos has quit
      • grumpi joined the channel
      • j3r0 joined the channel
      • subho joined the channel
      • robattil1 joined the channel
      • EyePulp has quit
      • tierce joined the channel
      • raoulzecat joined the channel
      • microdex joined the channel
      • geetar has quit
      • eperzhand has quit
      • FreedomFighter has quit
      • Guest24569 joined the channel
      • eperzhand joined the channel
      • Guest24569 is now known as nathanhi
      • subho has quit
      • microdex joined the channel
      • the_rat has quit
      • DLSteve has quit
      • hapos joined the channel
      • microdex joined the channel
      • subho joined the channel
      • LondonAppDev joined the channel
      • veduardo joined the channel
      • SecondForm_Glenn joined the channel
      • josephkokenge has quit
      • felixn joined the channel
      • brat197 joined the channel
      • HassenPy has quit
      • iGeni joined the channel
      • iGeni
        im building a project where there will be alot of difrant heavy use chat rooms (text) what would u use
      • rabbit?
      • or stick with nodejs/socket.io
      • jnoob22
        you may want to ask in #nodejs or #javascript
      • pupil1 joined the channel
      • grumpi has quit
      • honestly the nodejs/socket.io has a good example in the Manning NodeJS book.
      • iGeni
        ill check that one
      • jnoob22
        iGeni, just know you likely won't get many responses on that in a #django chan. ;)
      • sayan has quit
      • mighty_mosquito joined the channel
      • HassenPy joined the channel
      • mighty_mosquito
        Hi, Where can I find the details about the implementation of the ORM in django?
      • any links?
      • codeme joined the channel
      • greg_f has quit
      • ChrisWarrick
        mighty_mosquito: Read the django source code?
      • brat197 has quit
      • davidszotten joined the channel
      • kenbolton joined the channel
      • JackSmack joined the channel
      • kennethreitz joined the channel
      • Knyght
        mighty_mosquito, there's some basic grounding here, but it doesn't get into too many details: https://www.youtube.com/watch?v=tkwZ1jG3XgA
      • saurabhjha joined the channel
      • codeme has quit
      • codeme joined the channel
      • jaddison has quit
      • jnoob22
        Knyght, mighty_mosquito that's a great video. Very lengthy and somewhat dry but good if you listen to it often.
      • sobersabre joined the channel
      • grumpi joined the channel
      • Xiti joined the channel
      • YuanModu joined the channel
      • tbaxter joined the channel
      • dheerajchand joined the channel
      • diek has quit
      • jessamynsmith has quit
      • jaddison joined the channel
      • vaibhav10jain has quit
      • codeme has quit
      • mmalone joined the channel
      • grumpi has quit
      • jessamynsmith joined the channel
      • DLSteve joined the channel
      • woxidu joined the channel
      • fission6 has quit
      • codeme joined the channel
      • microdex joined the channel
      • mine0901 joined the channel
      • codeme has quit
      • jessamynsmith has quit
      • knbk joined the channel
      • douedd has quit
      • douedd joined the channel
      • eperzhand has quit
      • dcz joined the channel
      • dcz
        hello guys
      • b4n4n4r4m4 joined the channel
      • tbaxter has quit
      • wub_wub joined the channel
      • i have no experience about web. I have task to build a portal.I dont know what i should use or not.Flask or Django , which i should choose ?
      • serjpy joined the channel
      • Slamtime joined the channel
      • b4n4n4r4m4
        hey there, I am having some trouble getting js to load on my pages from base.html. CSS seems to be loading just fine, and I have staticfiles loaded has anyone run into this problem before and what files should I post?
      • nkuttler
        dcz: django has more things built in, so you can probably get it done faster. flask comes with more flexibility but needs more time
      • kennethreitz has quit