#django

/

      • rpkilby has quit
      • Leeds joined the channel
      • JonesP has quit
      • NomadJim_ is now known as NomadJim
      • il joined the channel
      • domino14 joined the channel
      • disgrntld has quit
      • Audioburn has quit
      • graingert_ has quit
      • Hairy joined the channel
      • domino14 has quit
      • Victor87
        Trying to change the looks of my upload button. http://stackoverflow.com/questions/21842274/cro... how do I incorporate my {{ form.xlsxfile }} to work? Can't figure it out...
      • zacdev joined the channel
      • pydave6367 has quit
      • K_r3aPeR joined the channel
      • delgiudices joined the channel
      • delgiudices
        Is there any post/tutorial/talk/conference about commenting code?
      • bcSquared joined the channel
      • zeioth_ joined the channel
      • transit has quit
      • FunkyBob
        delgiudices: where what the code is doing is not clear, comment
      • generally the code should be clear in wat it's doing... or you're doing it wrong
      • dang`r`us
        personally I like the rule of thumb "code explains the how, comments explain the why"
      • raijin has quit
      • il is now known as Audioburn
      • delgiudices
        I thought of that just wanted to hear someone talking about it
      • dang`r`us
        that, and of course apidocs if you're writing some sort of library
      • FunkyBob
        dang`r`us: nice
      • zeioth has quit
      • pydave6367 joined the channel
      • Dev51328
        Documentation is pretty important, yeah
      • socketubs joined the channel
      • raijin joined the channel
      • bmac joined the channel
      • FunkyBob
        so is comprehensible code
      • uczekalla has quit
      • the longer it takes to understand what it's doing, the more likely you are to break it... and the less productive yo'll be
      • CAPITANOOO joined the channel
      • bmac joined the channel
      • socketubs has quit
      • bmac has quit
      • graingert_ joined the channel
      • bmac joined the channel
      • JonesP joined the channel
      • JonesP has quit
      • jaddison joined the channel
      • iion joined the channel
      • graingert_ has quit
      • transit joined the channel
      • Debnet has quit
      • lumidee has quit
      • lumidee joined the channel
      • slick666_work has quit
      • denys joined the channel
      • goctopus joined the channel
      • LeoAtWork joined the channel
      • frump joined the channel
      • dcrouch has quit
      • dcrouch joined the channel
      • msg555 has quit
      • duoi
        hi. i have a submodel of user called 'setup' which has a bool called 'verified'. i'm trying to add that as a field within UserAdmin so that it displays on django admin but it doesn't accept 'verified' on it's own nor 'setup.verified' (it will only accept top-level properties of user). how can i access 'verified'?
      • kyheo joined the channel
      • rpkilby joined the channel
      • Victor87
        FunkyBob: Is there any easy way to get the file name? After I upload it? newfile = Xlsx(xlsxfile = request.FILES['xlsxfile']) newfile.save() what it looks like atm.
      • FunkyBob
        duoi: add an accessor method to the ModelAdmin
      • pydave6367 has quit
      • Victor87: request.FIES['xlscfile'].name ?
      • Victor87
        I've tried, I get 'name 'requst' is not defined'
      • FunkyBob
        fix your typo [and mine]
      • hpanago has quit
      • robbyoconnor joined the channel
      • Victor87
        'Exception Value: Can't convert 'Xlsx' object to str implicitly' Progress?
      • I wrote: getname = Xlsx(xlsxfile = request.FILES['xlsxfile'].name)
      • pydave6367 joined the channel
      • rpkilby has quit
      • FunkyBob
        you sure it wants a filename, and not the file object to read from?
      • also...
      • Victor87
        I fixed it
      • FunkyBob
        as you see in the topic
      • paste code and full traceback
      • Victor87
        Sorry, I seem to be so tired atm, sorry FunkyBob.
      • It's solved anyways, thanks!
      • FunkyBob
        quack
      • fV3 has quit
      • mihow has quit
      • bastiben has quit
      • marr has quit
      • Victor87
        Is there any way to reference MEDIA_ROOT? In other files outside of settings.py? I know django does it automatically in some specific django functions.
      • FunkyBob
        from django.conf import settingsg ; settings.MEDIA_ROOT
      • bmac joined the channel
      • but this isn't what you want, I rekon
      • you want either to accessvia your FileField, or look at the storage api
      • Victor87
        True, it has to exist a full path+filename function. I've learned a lot these last few days, but man... The stupid crap I do
      • duoi
        FunkyBob, I did (i think), but I'm specifically trying to get it so that I can have it as a sortable column on the /admin/auth/user/ page
      • bwut has quit
      • FunkyBob
        should be able to sort by a filefield..
      • jacinda has quit
      • dangayle has quit
      • shangxiao joined the channel
      • dcrouch has quit
      • bswanson joined the channel
      • maryokhin has quit
      • transit has quit
      • maryokhin joined the channel
      • CandyApples joined the channel
      • Dragotha has quit
      • CandyApples has quit
      • Victor87
        FunkyBob: Btw, ' 1) Provide a one-off default now (will be set on all existing rows)' My question is, is there any way to just clean the whole thing? Fresh start.
      • domino14 joined the channel
      • bcSquared has quit
      • scarabx joined the channel
      • FunkyBob
        wha?
      • a little context will help Victor87 ... what are you talking about?
      • Victor87
        Is there any easy way to reset my database completly? python manage.py flush doesn't clean it 100%
      • FunkyBob
        drop it and start again
      • but that won't stop makemigrations asking for defaults
      • SteenJobs_ has quit
      • Victor87
        I really don't understand what I'm supposed to write as defaults.
      • __love__
        default values
      • FunkyBob
        what should go into existing records for that field
      • yes, we know there are no existing records... but migrations CAN NOT assume that
      • and often your DBMS won't permit empty values... because your schema does not allow it
      • what sort of field is it?
      • transit joined the channel
      • hyperair joined the channel
      • Dragotha joined the channel
      • kurse joined the channel
      • msg555 joined the channel
      • kurse
        I deployed my django site yesterday, but I am getting an error 500 periodically on just one page of my site.
      • does anyone know what could cause this?
      • FunkyBob
        what does the error message say?
      • davea has quit
      • kurse
        This is on a server with debug off
      • and the process is running independent from my console.
      • davea joined the channel
      • in my nginx error log I get something somtimes that says permission denied, but I gave full permissions on that file and the socket is given 666
      • ojii|work joined the channel
      • Victor87
        FunkyBob: Sorry, I fell asleep. Off to bed. Thanks for today. Gn!
      • danifus joined the channel
      • buzzzz has quit
      • phood has quit
      • phood joined the channel
      • jaddison has quit
      • FunkyBob
        kurse: it will still log errors... and even email them to you, if you added yoursetlf ro settings.ADMINS
      • delgiudices has quit
      • buzzzz joined the channel
      • geetar joined the channel
      • msg555 has quit
      • gopar joined the channel
      • pydave6367 has quit