#django

/

      • nalik891 has quit
      • heatmeiser joined the channel
      • jessamynsmith joined the channel
      • meisth0th has quit
      • snurfery joined the channel
      • rriehle has quit
      • rtpg has quit
      • doza joined the channel
      • sudomarize
        mattmcc: when i try to migrate the updated model, i get "'DatabaseOperations' object has no attribute 'geo_db_type'", any idea what that is?
      • mattmcc
        Oh, you need to change your DB backend.
      • Coldblackice_ joined the channel
      • And there's some DB setup that's needed for the geographic functions to work. https://docs.djangoproject.com/en/1.8/ref/contr...
      • dethos joined the channel
      • chimerahitman has quit
      • Coldblackice has quit
      • sudomarize
        mattmcc: is this definitely the method you'd recommend to get this geo functionality working?
      • ksoviero has quit
      • dogarrhea has quit
      • trustyhank has quit
      • chimerahitman joined the channel
      • mattmcc
        sudomarize: Yeah, using real geographic fields instead of doing the math by hand with plain lat/lon fields performs much better.
      • rtpg joined the channel
      • sudomarize
        mattmcc: ok great. i guess i need to use postgis (postgresql is my db)?
      • mattmcc
        Yeah.
      • rtpg has quit
      • cornjuliox joined the channel
      • sudomarize
        mattmcc: this shouldn't really slow down my application should it? Got this irrational fear that it might do some damage to my apps performance
      • mattmcc
        No, postgis is simply a collection of functions and data types.
      • mfcovington joined the channel
      • heyts has quit
      • voodoo-burger joined the channel
      • sudomarize
        mattmcc: is there a guide that has a list of all dependencies? i keep getting things like 'libxml2 config not found' (fixed), gdal-config not found
      • mattmcc
      • heyts joined the channel
      • anth_x joined the channel
      • pyface joined the channel
      • voodoo-burger has quit
      • rtpg joined the channel
      • WeiJunLi
        help with this NoReverseMatch -> https://dpaste.de/OYc5
      • jessamynsmith has quit
      • Nizumzen
        don't know if anyone has seen this but these are the results of the django community survey https://docs.google.com/forms/d/1Owv-Y_beohyCm9...
      • pretty interesting data
      • mcspud joined the channel
      • mattmcc
        WeiJunLi: Note that the exception reports the arguments it tried, and pk is an empty string.
      • exploreshaifali joined the channel
      • davur has quit
      • exploreshaifali
        I am trying to set form widget with CreateView and ModelForms, have set widget in Meta class of ModelForms class but it is not working
      • WeiJunLi
        mattmcc: so it means there's something wrong with the queryset maybe?
      • exploreshaifali
        can anyone give some solution
      • davur joined the channel
      • mattmcc
        WeiJunLi: Given your template, it just means checkout_id didn't have a value in it.
      • mfcovington has quit
      • WeiJunLi
        mattmcc: at that point pk shouldn't retrieve an empty string :\
      • heatmeiser joined the channel
      • samuel_ joined the channel
      • voodoo-burger joined the channel
      • mattmcc: what you suggest to do?
      • tchalla has quit
      • mattmcc
        WeiJunLi: Well, what is checkout_id supposed to be? Your view doesn't appear to be setting it in the context.
      • voodoo-burger
        is it possible to give a short_description to a modeladmin action?
      • grindmodeon joined the channel
      • grindmodeon has quit
      • x1337807x joined the channel
      • sudomarize joined the channel
      • mattmcc
        voodoo-burger: Yep, just set their short_description attribute. https://docs.djangoproject.com/en/1.8/ref/contr...
      • x1337807x has quit
      • rtpg has quit
      • voodoo-burger
        but i have to do it outside and after the def of the action in question right?
      • actions = ['approve']
      • def approve(self, request, queryset):
      • rows_updated = queryset.update(approved=True, date_approved=datetime.datetime.now())
      • if rows_updated == 1:
      • message_bit = "1 comment was"
      • else:
      • message_bit = "%s comments were" % rows_updated
      • self.message_user(request, "%s successfully approved." % message_bit)
      • approve.short_description = 'Approve selected comments'
      • oops, guess that doesnt work
      • exploreshaifali has quit
      • x1337807x joined the channel
      • WeiJunLi
        mattmcc I'll just handle that later, just removed that part for now cuz the logic stuff isnt working properly, can you take a look into this other problem? https://dpaste.de/KizO
      • mattmcc
        When you override request methods like get, post, etc, you still need to retain their ability to accept arbitrary keyword arguments, like pk.
      • Since it's one of the named groups in your urlpattern.
      • mribeirodantas has quit
      • WeiJunLi
        mattmcc: oh alright added *args,**kw
      • The view app.views.CheckOutView didn't return an HttpResponse object. It returned None instead.
      • should I use render_to_response instead of render?
      • Zanetski has left the channel
      • mattmcc
        To keep with the UpdateView workflow, on a valid post you should return a redirect. Normally UpdateView would return self.form_valid(form)
      • RicoAlpha has quit
      • kenbolton has quit
      • eVRiAL has quit
      • WeiJunLi
        mattmcc: where is that info? I can't find in the docs, also in the docs I only see 2 things about UpdateView
      • darkPassenger joined the channel
      • darkPassenger has left the channel
      • jessamynsmith joined the channel
      • Nux17
        voodoo-burger: this should work
      • telex joined the channel
      • kenbolton joined the channel
      • john2x joined the channel
      • minot joined the channel
      • Debnet has quit
      • WeiJunLi
        mattmcc: seems it isn't related to the way I am rendering it, traceback here https://bpaste.net/show/f3a65097ee8c
      • metaljack34 joined the channel
      • metaljack34
        I can load css and js files but the images in the line 135, 141 and 147 are not rendered. However, if I go to the url, i can see the images. Does somebody know why this is not working? http://hastebin.com/ogujedelur.django
      • mfcovington joined the channel
      • SecondForm_Glenn joined the channel
      • mattmcc
        WeiJunLi: You're not returning anything if the form is invalid.
      • Nux17
        metaljack34: Is the path correct ?
      • mattmcc
        It'd probably be easiest to just call up to the parent method with super()
      • metaljack34
      • mattmcc
        metaljack34: What does "manage.py findstatic img/slide_one.png" say?
      • WeiJunLi
        mattmcc: if form.is_valid() ?
      • metaljack34
        mattmcc: Found 'img/slide_one.png' here: ~/prj/static/img/slide_one.png
      • Nux17
        WeiJunLi: Yep, this is how you can tell a form is valid or not
      • mattmcc
        metaljack34: Okay, so it's probably not a Django issue.
      • You're not seeing 404s in Firebug or other inspector tools, are you?
      • metaljack34
        mattmcc: Nope, I can actually see the thumbnail of the image if I hover the link in the firebug
      • mattmcc
        So, yeah, it'd be a CSS thing.
      • Nux17
        Should be a CSS issue then
      • mattmcc
        Maybe the divs just aren't big enough to see the image.
      • Or Bootstrap is doing something strange.
      • WeiJunLi
        mattmcc: I've added def form_valid(self, form): super(CheckOutView, self).form_valid(form) but I keep receiving the same errr
      • elsimir joined the channel
      • mattmcc
        WeiJunLi: It's saying you're not returning a response if the form is _not_ valid.
      • metaljack34
        mattmcc: I see. The plain html template actually works. Anyway, I'm gonna play with the html. Thanks
      • voodoo-burger has quit
      • pax- has quit
      • WeiJunLi
        mattmcc: can you be more specific?
      • pyCasso joined the channel
      • microdex has quit
      • mattmcc: I think it is pretty clear, if form.is_valid() return the render success_url otherwise form = form_class
      • metaljack34 has quit
      • if I have a post() why would be necessary a form_valid(), don't get it.
      • because in post it verify if the form is valid or not :\
      • FunkyBob
        WeiJunLi: in a CBGV? because it's a hook point for you to decide what happens when the form is deemed valid
      • SteenJobs
        any idea why manage.py migrate wouldn’t be detecting migration files? i’m trying to load fixture data and it tells me a column doesn’t exist…yet it exists in the models.py file and in a specific migration file.
      • WeiJunLi
        FunkyBob: so would def form_valid(self, form): return super(CheckOutView, self).form_valid(form) be enough ?
      • mattmcc said it isn't returning a response if the for is _not_ valid and I'm not sure what he did mean by that
      • Nux17
        SteenJobs: happened to me, finished setting the column manually through my SQL admin
      • FunkyBob
        WeiJunLi: if that's all it did, you wouldn't need to override it
      • what do you want to happen when the form is valid?
      • I haven't seen any of your code, yet, so...
      • SteenJobs
        Nux17: it would involve a lot of manual work though…i presume if this column doesn’t exist then there are a bunch i’d have to create in postgres from scratch, so ideally i’d like to get manage.py migrate to work...
      • sudomarize
        mattmcc, i'm getting "Cannot use object with type float for a geometry lookup parameter." when trying to run migrate after setting up postgis. Any ideas as to what could be the problem?
      • FunkyBob
        sudomarize: you've passed a float for use in a geometry lookup
      • saschpe has quit