#django

/

      • ktosiek has quit
      • spudbook has quit
      • rydgel joined the channel
      • ktosiek joined the channel
      • jdunck has quit
      • dowstreet joined the channel
      • FunkyBob
        toli: ouch
      • that's pretty old and fucked
      • toli did not understand what was happening and was going to throw himself off the balcony
      • toli
        again the syntax error
      • :)
      • urth
        FunkyBob: he also uses and cpanel, hence the autoremoval of mod_wsgi on upgrades :p
      • F1skr has quit
      • toli
        libpython2.4.so.1.0 => /usr/lib64/libpython2.4.so.1.0 (0x00007f7f13250000)
      • cryyy
      • I don't get it urth
      • why again
      • hyperboloid joined the channel
      • moneydouble
        FunkyBob: what do you think of crispy-forms? I need a template to have multiple forms because I cant render them right so trying to find a solution.
      • velcrow joined the channel
      • margle has quit
      • I only need this for 1 thing, so using something like crispy-forms seems a little too much… its just for 1 page.
      • dowstreet
        having a problem reading from an UploadedFile object in a view function... file appears to be in request.FILES, and .name and .size return expected values, but .read() returns a 0 length string
      • NeilB4Zod joined the channel
      • FunkyBob
        moneydouble: I think I really need to take a look at crispy forms one of these days
      • moneydouble: what is this one thing you need?
      • rydgel has quit
      • crispy-forms seems to be far more advanced than my own "render forms with templates" tool - formulation
      • sudobangbang has quit
      • urth
        toli: where did you get the mod_wsgi code this time?
      • Tyriss joined the channel
      • toli
      • moneydouble
        FunkyBob: Well, I have a form (modelform) and it has some fields right. Well then I have some dynamic fields being created inside __init__ based on a db table results. So I want to manually write out the html for those manually written fields and do a for loop for the dynamic fields… That way I can say <h2>Contact info and like <h2>Dynamic fields etc. See?
      • chrislkeller has quit
      • FunkyBob
        ok
      • not sure creating dynamic fields in init is.... great
      • urth
        toli: do you have python-2.7 development files installed?
      • wassup has quit
      • toli
        urth: I downloaded python 2.7.5 source and compiled too
      • dowstreet
        ah - weird. so i was reading in the file in a form clean method first to do some formatting validation - if i comment that out then I can read it successfully in the view function?!
      • moneydouble
        FunkyBob: how else could I do it? The fields are added by my customers so they can request additional custom information on registration
      • FunkyBob
        toli: why are you using such an ancient OS version?
      • ollie has quit
      • toli
        FunkyBob: because my provider gives me that with cpanel, and I share this server with 10 ppl
      • moneydouble
        its kinda hacking into it, I know but not sure how else it could be done really.
      • FunkyBob
      • toli
        FunkyBob: I use debian, and if I could I would install it
      • FunkyBob
        toli: cough up the $5/month and get yoursself a VPS
      • phobi has quit
      • maZtaiR has quit
      • toli
        FunkyBob: this what I will do finally :)
      • nihilista has quit
      • nicklo has quit
      • Tyrisss has quit
      • urth
        best news I heard today
      • ollie joined the channel
      • toli
        can I just download to mod_wsgi.so and replace it ?
      • FunkyBob
        the _only_ reason I have any cpanel based hosting is to provide clients with webmail without having to run PHP on my own servers
      • urth
        if it's binary compatible with your os. then yes
      • FunkyBob
        toli: you're using windows? I thought you said you were on centos?
      • moneydouble
        FunkyBob: interesting. Either way, any ideas on what I could do for the template of it? I thought about writing an if statement inside the loop saying if its any of the manual fields then dont show and just manually write those above the form… but that just seems a bit weird lol
      • toli
        FunkyBob: I use CentOs for my VPS, and Wheezy at home
      • FunkyBob
        moneydouble: use two forms
      • urth
        toli: that module you linked is for windows
      • so you cannot use it
      • moneydouble
        FunkyBob: yeah but can I do that with CBVs? or should I be using a FBV?
      • FunkyBob
        moneydouble: well, there's no out-of-the box CBVs for handling two forms.. so.. no...
      • but really... does your use case fit with a CBV anyway?
      • toli
        ha?
      • ah yes, oh sorry
      • chrislkeller joined the channel
      • the_rat_ has quit
      • moneydouble
        FunkyBob: dunno, still trying to get the hang of django so I have no idea which is better to use when.
      • toli
        it's been 8 hours I am on that
      • need some sleep
      • doing crap
      • the_rat joined the channel
      • the_rat has quit
      • endra has quit
      • katylava has quit
      • which ver to download ?
      • csotelo has quit
      • moneydouble
        FunkyBob: which do you use more? FBV or CBV?
      • hexsprite has quit
      • dowstreet
        do i need to explicitly close the read in the clean method?
      • FunkyBob
        moneydouble: fbv...
      • moneydouble: it's a matter of "right tool for the job"
      • moneydouble: I don't understand this craze of "we must try to use FBV for _everything_!"
      • moneydouble
        FunkyBob: lol true. I just gotta learn to be able to tell which is more appropriate for the use case.
      • mattmcc chuckles.
      • dowstreet
        anyone have an idea about this?
      • FunkyBob
        moneydouble: if you have to ask... use FBV
      • baniir joined the channel
      • anyway... gotta go see a house
      • moneydouble
        word, later. Thanks
      • nigelb has quit
      • nigelb joined the channel
      • sudobangbang joined the channel
      • chachan joined the channel
      • toli
        I give up, I will take new vps with squeeze
      • JainAmber has quit
      • little-key-yuki has quit
      • and no cpanel
      • spudbook joined the channel
      • chrisjones has quit
      • chrislkeller has quit
      • dowstreet
        i'm having a problem where I'd like to read in an UploadedFile in a form clean method to do some validation, and then if valid, also read the UploadedFile again in the view function (all without saving to disk). is this possible?
      • hyperboloid has quit
      • empty has quit
      • twilight_ has quit
      • FSCV has quit
      • nicklo joined the channel
      • dali joined the channel
      • nicklo has quit
      • mindlace has quit
      • nicklo joined the channel
      • theslow1 joined the channel
      • baniir has quit
      • i am able to read the contents either (i) in the form clean method from self.cleaned_data.get() or (ii) in the view function from request.FILES, but if i first do (i) then (ii) doesn't work. any ideas?
      • theslow1
        Hey every, what is the named link to get to the admin page? (instead of href="/admin")
      • i am looking for something simular to href="{% url admin_index %}"
      • Sharebear has quit
      • mattmcc
      • theslow1
        mattmcc, thanks
      • JainAmber joined the channel
      • heptal has quit
      • knite joined the channel
      • knite has quit
      • twilight_ joined the channel
      • culturelabs joined the channel
      • knite joined the channel
      • dlam has quit
      • bwreilly has quit
      • jeroengerits_ has quit
      • dowstreet
        ok - found it. the first read in the form clean method was leaving the file pointer at the end of the file. i added the line filename.seek(0) in the view function to move the pointer back to the beginning before reading again - seems to work!
      • moneydouble has quit
      • Oddity has left the channel
      • dowstreet has quit
      • cewing is now known as cewing|afk
      • tdy joined the channel
      • macabre has quit
      • velcrow
        I'm trying the following in my template:
      • <input id="id_first_name" type="text" name="first_name" maxlength="50" var="{{ profile.first_name}}"/></p>
      • but the "var" is not working, the {{ }} don
      • ''t seem to be working here
      • I tried removing the quotations too, no luck
      • mattmcc
        Well, is profile in the context? Does it have a first_name attribute?
      • velcrow
        yes
      • mattmcc
        Are you sure?