#django

/

      • FunkyBob
        floats are imprecise...there are some values they just can not represent
      • Decimal is able to accurately represent decimal values
      • prs
        from decimal import Decimal
      • lyrae
        docs say if i don't set handler404, django will use my 404.html page in my template dir, correcT?
      • FunkyBob
        lyrae: correct... the default handler404 uses that
      • bitmonk has quit
      • lyrae
        so basically, all i have to do to use a custom 404 view, is create 404.html
      • zadark|2 is now known as zadark
      • FunkyBob
        no
      • views and templates are different things
      • you can create a custom 404 template
      • phonkee joined the channel
      • lyrae
        oh
      • and tell the default 404 handler to use it?
      • FunkyBob
        a custom 404 view would require writing a view and setting it as handler404
      • the defailt 404 view will use 404.html
      • keimlink has quit
      • default
      • lyrae
        alright ill try
      • glosoli joined the channel
      • monstermusan
        okay so invoice_amount_exvat = str(Decimal(invoice_details.invoice.invoiceamount.replace(',','.')) * Decimal('0.8'))
      • wait
      • FunkyBob
        monstermusan: why doesn't your invoice store the amount as a Decimal already?
      • what type _is_ it stored as?
      • prs guess string
      • monstermusan
        its c5
      • FunkyBob
        c5?
      • what is c5?
      • more explosive than c4?
      • monstermusan
        dynamics c5
      • lawgon
        semtex
      • monstermusan
        smaller version than navision
      • FunkyBob
        monstermusan: huh?
      • prs 's confused
      • monstermusan
        it comes from a web api
      • md4d joined the channel
      • FunkyBob
        and they pass prices as strings?
      • monstermusan
        it o
      • it cm
      • aaaah
      • FunkyBob
        what sort of butt-fuckery is this?
      • Necrophobic joined the channel
      • prs
        monstermusan: so you do some kind of integration with a 3rd party right?
      • monstermusan
        it comes from a soap thingy
      • FunkyBob
        SOAP? this just gets worse and worse
      • lawgon once had an assignment to replace navision
      • linelevel joined the channel
      • and they don't have a way to pass proper types in their XSD?
      • or are you just not deserialising properly?
      • lawgon
        dynamics c5 is an M$ thingie
      • linelevel
        Hi. I registered my latest model with the admin, and it shows up in the admin, but it doesn't show up in the list of permissions that I can give to users or groups. What do I need to do to update the permission list?
      • monstermusan
        FunkyBob: i think they return it as a string, i am using suds
      • dmrz joined the channel
      • Back2Basics joined the channel
      • lawgon
        linelevel, afaik it should be there by default
      • look harder - it must be there
      • linelevel
        lawgon: Yes, that's always been the case for me as well.. which is why I'm confused by this.
      • lawgon: no.. I'm not blind :) ...it's relaly not there.
      • really*
      • yesimon has quit
      • lawgon
        reload the page - clear your browser cache - buy spectacles ;-)
      • BlindHunter joined the channel
      • gabrielo has quit
      • linelevel
        lawgon: yes, of course I tried those things already. Restarted the server, opened in a fresh browser instance with no cache. It's actually not there.
      • swi joined the channel
      • WaqarAzeem joined the channel
      • monstermusan
        i know very little about suds, but it returns an object or something similar
      • tbh i still understand very little about python
      • i mostly just hit the keyboard and at some point it will write some code i can use.
      • FunkyBob
        if you've given suds the WSDL/XSD from the service, it _should_ be able to convert types for you
      • monstermusan
        i have
      • at least i think i have
      • i gave it a url and a location
      • Rozza joined the channel
      • url is wsdl and location is something else
      • :P
      • FunkyBob
        of course, since most SOAP libs are pathetically incapable of handling more than a fraction of the XSD data types...
      • they probably _are_ sending values as strings
      • however, Decimal can take strings directly... it's very good at that
      • apollo13
        suds ftw, it's the only useable soap lib imo
      • gabrielo joined the channel
      • reuf has quit
      • monstermusan
        php soap rocks
      • :S
      • not
      • apollo13
        monstermusan: soap sucks, php doesn't change much there :þ
      • monstermusan
        but if soap sucks and php sucks and the php soap lib sucks
      • then it pretty much sucks
      • FunkyBob
        yep
      • monstermusan
        whats wrong with soap
      • eltigre
        php is a war against the platform, so the code looks like a battlefield
      • monstermusan
        well web servuces anyway
      • eltigre: if you use proper coding standard its okay i think
      • i like python alot more
      • eltigre
        python is about making love to the platform, so a good django project looks like porn
      • kilae joined the channel
      • monstermusan
        only problem python/django is harder to deploy
      • knite has quit
      • prs
        harder than what?
      • mattmcc
        Becoming an expert in PHP is a process of learning how to write good apps despite the language's design.
      • FunkyBob
        than using somethingas dangerous as mod_php
      • mattmcc: +1
      • mattmcc
        monstermusan: mod_wsgi is pretty dead simple.
      • WSGIScriptAlias, done.
      • eltigre
        it really depends on the engineer, but the language makes the differences extremer
      • lyrae
        i've been doig php for 7years and there's no way to become an expert in that
      • lawgon
        gunicorn is simpler
      • monstermusan
        apt-get install php and you are running
      • lyrae
        the devs are not consistant
      • charettes
        I agree that gunicorn is simpler
      • eltigre
        I mean for example some python 3 projects will look terrifying what with all the chinese character identifiers and all ;-)
      • mattmcc
        Eh, I considered myself a PHP expert after 9 years, and that was before there was such a thing as a PHP web framework.
      • lyrae
        but for some reason, i find php easier to pickup than python
      • monstermusan
        it took me the better part of a day to setup django on my webserver
      • eltigre
        yes php is easier... much less concepts to get into your brain
      • monstermusan
        and make the code autoreload so i didnt have to restart apache each time i made a chang
      • e
      • mattmcc
        monstermusan: That's what the runserver is for.
      • lawgon
        php is good entry level thing to pull people into using open source
      • monstermusan
        but i dont like to work locally
      • eltigre
        php is a really good script-kiddy language
      • lawgon
        monstermus, you use ftp to upload your php code? or some vcs?
      • eltigre
        and you can get away easily without any devops or sophisticated software design
      • monstermusan
        i use ftp just to be gay
      • mostly we develop on client machines where vcs was not possible
      • apollo13
        monstermusan: uhm…
      • vsrao joined the channel
      • monstermusan
        its better to develop using a test setup, making sure it works and then commit to live version
      • however in php its often not a choice you do
      • apollo13
        that's a lame excuse
      • eltigre
        you can do devops in php
      • but if you care about devops you usually don't feel that comfortable about php anyway...
      • monstermusan
        for the systems we made its often not viable
      • since most projects only take 3-4 days
      • eltigre
        using chef with php is sort of a strange fit
      • monstermusan
        i will not defent the way i use/used php, because i simply dont know better
      • paiti has quit
      • i have no idea what devops is
      • eltigre
        no problem, I don't want to bash php too much. I just don't like it personally and I think it can get under your skin ^ ^
      • monstermusan, sort of using repositories, deployments, testing environments and then automating everything with scripting, maybe including some scrum or project management, that's devops to me
      • monstermusan
        i like php, but i love python
      • eltigre
        and I'm not that much into it though I think I should be
      • for example chef, fabric, pip and virtualenv fall into that category
      • monstermusan
        eltigre: yeah i think thats good for larger projects or projects that thats ongoing
      • lawgon
        monstermus, vcs is a must even for a hello world app
      • djapo has left the channel
      • monstermusan
        but often we needed to change a few pages on a webshop which took a day
      • eltigre
        if you really know what you are doing you can roll stuff out really fast... I mean you just have a default fabric template and requisition another slice or machine and the site is up
      • djapo joined the channel
      • emr joined the channel