#django

/

      • this_is_tom joined the channel
      • hamdjan__ has left the channel
      • hamdjan__ joined the channel
      • rpkilby has quit
      • this_is_tom has quit
      • rpkilby joined the channel
      • lumidify joined the channel
      • idontneedanick joined the channel
      • rpkilby has quit
      • rufus_ joined the channel
      • mattmcc
        wyoung: No, they're in SE Asia but not Australia.
      • hamdjan__: Eh, can you rephrase? Or maybe show us an example of what you mean?
      • idontneedanick has quit
      • idontneedanick2 joined the channel
      • rufus_
        HI there! I have a model which includes some foreignkeys...When creating the template using for loop, I would like these foreignkeys fields to appear at the top of each relative subfield...but same are repeated on each line...where is my mistake? https://dpaste.de/Pwit
      • rpkilby joined the channel
      • hamdjan__
      • rpkilby has quit
      • hvpc has quit
      • tlab has quit
      • BakaKuna has quit
      • gopar joined the channel
      • tlab joined the channel
      • BakaKuna joined the channel
      • jackhum joined the channel
      • mattmcc
        hamdjan__: That would work fine.
      • htcoder has quit
      • hamdjan__
        mattmcc, oh, then i'll retry and see what went wrong, thanks
      • dcrouch has quit
      • rodorgas has quit
      • mattmcc
        rufus_: What does your view look like?
      • isthmian joined the channel
      • rufus_
        mattmcc: hi. on any row for the staff name, position etc, also the header branch is repeated, while I would like the branch name appearing only once at the top of the staff names..
      • isthmian has quit
      • cyphase joined the channel
      • ironfroggy joined the channel
      • lucas_ai joined the channel
      • BlindHunter joined the channel
      • hamdjan__ (yep, got it working now, had some for loop mistakes)
      • lumidify has quit
      • deltaskelta has quit
      • deltaskelta joined the channel
      • bayman joined the channel
      • bayman
        do i need sendmail installed for django to send mail and error reports?
      • lucas_ai joined the channel
      • Paradisee joined the channel
      • Jaxkr joined the channel
      • mattmcc
        No, but you do need to tell Django what SMTP server to use.
      • Jaxkr
        recommended method of redirecting to ?next?
      • mattmcc
        Whether that's local, some MTA of your own, or a service like Mailgun.
      • bayman
        i set it to gmail but it's not sending
      • Jaxkr
        bayman: look into mailgun
      • cbuchler joined the channel
      • lumidify joined the channel
      • bayman
        https://dpaste.de/CESz is there anything wrong w/ my logging settings?
      • tonythomas joined the channel
      • jessamynsmith joined the channel
      • looks like mailgun is deprecated in favor of anymail
      • Jaxkr
        mailgun is an smtp provider my friend
      • well transactional email
      • bayman
        oh i was looking at the django-mailgun package
      • jessamynsmith has quit
      • Jaxkr
        I know
      • :P
      • you don't need to use anymail. sparkpost and mailgun are smtp compatible
      • lanshark joined the channel
      • bx2 joined the channel
      • Jaxkr has quit
      • benbacardi joined the channel
      • shredding joined the channel
      • shredding has quit
      • markus-k joined the channel
      • sanketdg joined the channel
      • therue joined the channel
      • therue joined the channel
      • rufus_ has quit
      • bayman has quit
      • therue joined the channel
      • boxbeatsy has quit
      • ironfroggy joined the channel
      • dmmoody joined the channel
      • dmmoody has quit
      • olrrai joined the channel
      • timkofu joined the channel
      • this_is_tom joined the channel
      • this_is_tom has quit
      • reisio has quit
      • lanshark has quit
      • hyperair joined the channel
      • lorddaedra has quit
      • space-wizard joined the channel
      • vinny3 has quit
      • vinny3 joined the channel
      • Tomatosoup- joined the channel
      • flobin joined the channel
      • Qritz has quit
      • Poppabear has quit
      • idontneedanick2 has quit
      • ironfroggy joined the channel
      • Paradisee has quit
      • flobin
        hi everyone, I'm trying to include a form in a ListView, but I'm having some trouble understanding this traceback: https://gist.github.com/Flobin/56bdaf52094dd7b9...
      • anyone know what I'm doing wrong?
      • akki has quit
      • FunkyBob
        why would a ListView have a self.objct ?
      • you've mixed incompatible stuff, flobin
      • flobin
        because I don't really know what the hell I'm doing... heh
      • FunkyBob
        it would help, of course, if you showed your code
      • flobin
        oh the views.py and template is in that link also
      • FunkyBob
        oh, I see
      • so, the ModelFormMixin expects to have a SingleObjectMixin with it... but ListView uses MultipleObjectMixin
      • I would recommend have your list view submit to a different view that processes the post
      • that way if there's validation errors, it can re-display the form.. clean up, and redirect back to the list
      • flobin
        right, I wasn't planning on the ListView actually handling the form submission
      • but I would like to (be able to) display the form in the ListView
      • FunkyBob
        so you mixed in the modelformmixin because....
      • flobin
        because I thought that's how you get the form into the template...
      • should it just be in def get_context_data(self, **kwargs): ?
      • FunkyBob
        yes
      • flobin
        ah sweet, this works
      • thanks so much FunkyBob
      • MarkTheMark
        does anyone know how to create a post form and comment form for the django rest framework? (not django) http://192.241.153.25:8000
      • lorddaedra joined the channel
      • akki joined the channel
      • lumidify has quit
      • mingrammer has quit
      • sifat
        Hi all - when using a ForeignKey, can I specify somehow what the foreign key should be?
      • mattmcc
        You can specify which field on the related model to use.
      • sifat
        ah ok, thanks. and can I set primary_key=True on the related model even if it's not a true primary key?
      • i.e. not distinct for every row
      • mattmcc
        Not sure I follow.
      • k_sze[work] has quit
      • sifat
        e.g. model A has only the field username. model B has username and company. In a view, I want to display the usernames found in model A (comes from a MS SQL DB), and the company from model B (comes from Salesforce).
      • adsworth joined the channel
      • mattmcc
        Okay, the ORM doesn't really support tables that lack a proper primary key.
      • sifat
        I see. In this scenario, how would I look up the company name from a username from the MS SQL model? (note that I've brought both into ORM)
      • deltaskelta has quit
      • jaykay joined the channel
      • since the company name only exists in the Salesforce model
      • mattmcc
        Seems like you want ForeignKey(ModelB, to_field='username')
      • bx2 joined the channel
      • sifat
        ah ok, let me try that. Were you saying that this is unsupported in Django ORM?
      • mattmcc
        No, that works fine. The potential problem is if the tables really do lack a primary key.
      • If username is unique, you might be able to use that.
      • olrrai has quit
      • sifat
        doesn't Django automatically build a primary key for each model unless I specify primary_key=True for a particular field?
      • jessamynsmith joined the channel
      • mattmcc
        It puts a field named 'id' on the model, but that has to also exist on the table.
      • sifat
        oh ok. in that case, Salesforce does have one. the MS SQL table holding usernames doesn't. but the usernames are unique on the MS SQL table