#django

/

      • buckley has quit
      • ser_barry joined the channel
      • DarkSector
        different forms to different views
      • realnot_
      • DarkSector
        the second view doesn't need to do anything other than get the data, process it and then redirect it to the same next view
      • realnot_, exactly like you have it right now
      • v0r0nwe has quit
      • ser_berry has quit
      • ser_barry is now known as ser_berry
      • Audioburn
        pembo13, this is a huge pain in the ass
      • pembo13
        Audioburn: what are you trying to accomplish, and what problems are you having?
      • Audioburn
        pembo13, same thing, quering a GFK
      • querying*
      • pembo13
        and what's happen (or not) ?
      • bender314 has quit
      • realnot_
        DarkSector: but different view mean also different urls
      • DarkSector
        yes
      • just point the action of the form to the other url
      • TheJoey
        Can anybody help me out with an ORM issue that's breaking my brain? My goal is in a comment at the bottom: https://dpaste.de/GRgv
      • Audioburn
        pembo13, I guess I need to work on understanding ContentType -- with that link I posted, I tried just copying and pasting and replacing things, which did not work
      • sheppard joined the channel
      • pembo13, i.e context['reviews_for_user'] = Review.objects.filter(content_type=ContentType.objects.get_for_model(reviewed_i
      • realnot_
        for the first form /partner/slug/contact for the second form: /partner/slug/order and both render the contact.html template?
      • Audioburn
        ...tem))
      • pembo13
        Audioburn: i'll need dpaste of models and offending code
      • tbaxter
        realnot_: you’re already sending the form posts to two different URLs, are they different views, too?
      • realnot_: forget rendering. Processing.
      • most likely, the view will just process and redirect
      • realnot_
        tbaxter: right now yes, because i tried to follow your suggestion of ths afternoon
      • tbaxter
        good
      • Audioburn
      • tbaxter
        so, just have the view do it’s work and save the form.
      • JesseH joined the channel
      • Audioburn
        i get that reviewed_item is not defined, but I don't know what the "get_for_model" parameter should be
      • reading contenttype docs atm
      • DarkSector
        tbaxter, or have the form do the saving and just have a formview use that form
      • ybathia
        I have loaded data in the database using fixture and now I want to add more records to that data. whats the best way to do it? shall i update the initial_data.json to have more records or shall I create a new json file with only the additional records?
      • Audioburn
        pembo13, also that tab shouldn't be there, just a typo
      • DarkSector
        ybathia, overwrite the old one
      • realnot_
        tbaxter: but the second view, doesn't works, i can receive all the POST data, but the validation doesn't pass, and i don't know why (all field are filled)
      • DarkSector
        dumpdata again
      • pembo13
        Audioburn: you'll want a dbindex on object_id by the wya
      • way*
      • DarkSector
        realnot_, you see, that's a separate issue. Post your view/form for that
      • ybathia
        DarkSector: Thanks a lot sir
      • mmmikey joined the channel
      • realnot_
        tbaxter: aaaa i got it!
      • Audioburn
        pembo13, dbindex?
      • and why?
      • sonoflight joined the channel
      • Knyght has quit
      • realnot_
        tbaxter: i use 2 view to save the data in the database and 1 view to render the template :D
      • ?
      • tbaxter
        right
      • pembo13
        Audioburn: you'll likely be doing queries against it at some point
      • Audioburn
        like now
      • realnot_
        tbaxter: coool
      • pembo13
        Audioburn: what error(s) are you getting
      • tbaxter
        although you CAN let one view carry both the rendering and processing one view, if that makes more sense
      • pembo13
        Audioburn: you're not querying against it yet
      • sonoflight has quit
      • garrypolley joined the channel
      • Audioburn
        oh ok and sec
      • realnot_
        tbaxter: is better?
      • Knyght joined the channel
      • acangiani has quit
      • DarkSector: yes, i'll try to write the tbaxter solution, then we can debug the view
      • DarkSector
        coolio
      • realnot_
        tbaxter, DarkSector thank you guys
      • DarkSector
        yw
      • elit3x has quit
      • sanketdg has quit
      • TheJoey
        Any takers for my confusion?
      • michalmo joined the channel
      • sonoflight joined the channel
      • garrypolley has quit
      • TurBoss joined the channel
      • DTekk joined the channel
      • DarkSector
        TheJoey, I looked at it, but I don't know enough about GenericRelation to give advice
      • Hairy joined the channel
      • tylerea
        Does anyone know a good room for security best practices?
      • v0r0nwe joined the channel
      • DarkSector
        tylerea, security for django? or for web in general?
      • gyani joined the channel
      • TheJoey
        DarkSector: In theory, in this case, it should be functionally equivalent to the far end of a ForeignKey
      • tylerea
        locking down a server in general
      • DarkSector
        ##networking
      • should help
      • tylerea
        thanks DarkSector
      • matthiaswahl joined the channel
      • DarkSector
        TheJoey, what about limit to
      • limit_choices_to
      • diameter has quit
      • gyani
        hi, is there some method to check where is_valid fails?
      • DarkSector
      • garrypolley joined the channel
      • FreedomFighter has quit
      • gyani, just return the errors with the context
      • you'll know what the problem is in the template
      • TheJoey
        DarkSector: I need this for just one query though, not for the model as a whole. :-/
      • DarkSector
        ohj
      • dw joined the channel
      • TheJoey
        My end goal is to calculate distance based on a geo point on the Address model
      • Right now I have to build that query by hand, which is just disgusting
      • DarkSector
        TheJoey, could you paste that link again? I can't seem to find it
      • Hairy joined the channel
      • linkedinyou joined the channel
      • Or1on joined the channel
      • gyani
        DarkSector: new to django, i'll try to figure that out
      • TheJoey
      • djsnoops joined the channel
      • DarkSector
      • Audioburn
        pembo13, i got it to work \o/
      • gyani
        thanks!
      • DarkSector
        TheJoey, shouldn't values_list help here?
      • pembo13
        Audioburn: great, what was the problem?
      • DarkSector
        basically get the values_list for the address and then filter Merchant according to that
      • Audioburn
        in get_for_model(parameter), parameter needed to be defined as the model that the GFK was ultimately referencing, which in my case was the user model being reviewed
      • pembo13
        cool
      • sonoflight has quit
      • TheJoey
        Hmmm I'm not sure I follow, DarkSector.
      • DarkSector
        TheJoey, create a values_list of Address with the filter address_type=TYPE_PHYSICAL
      • then use that list to filter merchants
      • Merchant.objects.filter(addresses__in=Address.objects.filter(address_type=TYPE_PHYSICAL).values_list('pk', flat=True)) Then use annotate however you want I imagine
      • grumpi joined the channel
      • iooner joined the channel
      • primehax_ joined the channel
      • primehax_ has quit
      • Itkovian joined the channel
      • tbaxter
        Audioburn: the good news is you’re learning some of the reasons GFKs suck
      • TheJoey
        DarkSector: I don't think that will be able to give me what I'm looking for ultimately. I need to be able to do: Merchant.objects.annotate(physical_address=...), so that I can do: Merchant.objects.annotate(physical_address=..., distance=Distance(F('physical_address__location'), Point(...)))
      • Audioburn
        tbaxter, ha yea no kidding
      • wldcordeiro_ has quit
      • DarkSector
        TheJoey, can you not annotate a queryset?
      • BlindHunter joined the channel
      • oh right you can't
      • because django does it for all()
      • Timvde has left the channel
      • but yeah, that's a custom query like you said
      • Coldblackice has quit
      • TheJoey
        Damn, I was hoping I could eliminate the custom SQL. I barely understand how it's working.. which bothers me. :-/
      • timkofu has quit
      • xterm joined the channel
      • Well at least I'm not using .extra(). So at least there's that. :)
      • ircnode0
        I am planning to use django for information retrieval from amazon web service. I have to make use of amazon WSDL ( http://docs.aws.amazon.com/AWSECommerceService/... ) somehow. Can somebody give an overview how I can use WSDL-file for information retrieval from amazon web service?
      • rain0r joined the channel
      • DarkSector
        ircnode0, isn't that soap
      • soaplib is a good lib for that stuff
      • tsherk86 has quit