#django

/

      • joshfinnie has quit
      • jayant__ has quit
      • jayant__ joined the channel
      • jayant__ has quit
      • bmispelon joined the channel
      • dlam has quit
      • EyePulp joined the channel
      • joshfinnie joined the channel
      • EyePulp has quit
      • JohnRandom joined the channel
      • StvnOnly joined the channel
      • marsam has quit
      • johnnny22
        oh well, for now i'll go the full generic relation querying way.
      • Laybunz has quit
      • jweyrich joined the channel
      • cheshair
        Hi, I have Item model which has a FK to Family model. I have this url "/my-family/add-item" that is meant to create a new Item instance with FK set to "my-family" Family instance.
      • Suppose I want to use a CreateView CBV to serve that url, how can I make it aware of my-family instance?
      • How can I tell it that Family FK is to be set to my-family?
      • jayant__ joined the channel
      • Is that possible with a CreateView CBV? What do you think I have to override?
      • ErvisTusha joined the channel
      • ErvisTusha has quit
      • robbyoconnor has quit
      • arietis joined the channel
      • jweyrich has quit
      • mihasya has quit
      • maybe get_initial() method... I am having a look
      • Petazz has quit
      • tankbusta has quit
      • jawr has quit
      • unbit has quit
      • xav has quit
      • xav joined the channel
      • hm... i am not sure whether get_initial() or get_form_kwargs() can be my best option
      • unbit joined the channel
      • JesseH joined the channel
      • JesseH
        with urls.py, how do I make a default page url?
      • gazumps has quit
      • url(r'^/$', my_homepage_view), | didnt work
      • dqd
        Throw away the "/" character.
      • freannrak
      • k_sze[work] joined the channel
      • JesseH
        I could just do a '' then
      • Is that right?
      • davea has quit
      • Oh right freannrak thanks
      • FunkyBob
        JesseH: no, '' is not the same as '^$'
      • JesseH
        O.o
      • davea joined the channel
      • It works
      • '' works
      • FunkyBob
        sure, but it matches EVERYTHING else, also
      • or does it? hmm..
      • brain's not working
      • JesseH
        I will test and get back to you.
      • FunkyBob
        explicit is better than implicit
      • b0rsuk joined the channel
      • JesseH
        Just / led to my_homepage_view and "^hello/$" led to hello
      • So yeah it works like I want it to. :)
      • felix89 has quit
      • vakaras joined the channel
      • b0rsuk
        Hi, when I type 'python manage.py shell', I can't use uparrow/downarrow in the interpreter to reuse old commands. I'm on Debian Linux. Any idea how to fix this ? Something to do with readline ? up/down works in normal interpreter.
      • felix89 joined the channel
      • JesseH
        Anyone know anything about displaying .mesh models in a webpage? :-)
      • DjangoNewBee joined the channel
      • mihasya joined the channel
      • freannrak
        b0rsuk: interesting, uparrow works fine for me (snow lepoard). import readline?
      • DjangoNewBee has quit
      • Scottyob_ joined the channel
      • felix89 has quit
      • DjangoNewBee joined the channel
      • JesseH
        also dang came across something odd
      • DjangoNewBee has quit
      • test/ isnt showing up!
      • Is there anything against using the word test with python syntax?
      • the_rat joined the channel
      • Scottyob has quit
      • Scottyob_ is now known as Scottyob
      • mihasya has quit
      • the_rat has quit
      • the_rat joined the channel
      • okcomputer has quit
      • FunkyBob
        JesseH: no, there isn't
      • jSanp joined the channel
      • jSanp has quit
      • jSanp joined the channel
      • JesseH
        Okay that was odd. The line that handles the homepage url must be at the bottom of the url list.
      • md4d joined the channel
      • I didn't read anything about that in the documentation.
      • FunkyBob
        JesseH: not true
      • jangoh has quit
      • JesseH
        I can show you how it works with it only at the bottom mate. It must be a PEBKAC
      • Ariel_Calzada has quit
      • error*
      • FunkyBob
        first match wins.
      • NeilB4Zod joined the channel
      • are you still using '' instead of r'^$' ?
      • JesseH
        I am. :-)
      • I shouldnt be should I
      • spudbook has quit
      • FunkyBob
        ...
      • I _did_ tell you
      • chrismed has quit
      • FunkyBob hits the "I FUCKING WELL TOLD YOU SO!" button :P
      • JesseH
        <FunkyBob> or does it? hmm..
      • DOUBT
      • :P
      • bumbar has quit
      • FunkyBob
        "explicit is better than implicit"
      • schliep has quit
      • JesseH burps and rubs his belly.
      • JesseH
        Yes sir mister sir, sir.
      • FunkyBob
        no, open a shell, type "import this", and study
      • Ariel_Calzada joined the channel
      • JesseH
        :-)
      • b0rsuk
        freannrak: I was wrong, it's working.
      • freannrak has quit
      • _Qman has quit
      • benoitbb joined the channel
      • Wow ! Just: wow !
      • JohnRandom has quit
      • I have a great tip for anyone using 'readline' library(Everyone except Windows users?). I thought it works in Bash only, but it also works in Python interpreter. Check out '.inputrc' file in my 'config_files' repo. The readme file explains. https://github.com/monuszko/config_files
      • koenb joined the channel
      • zemanel joined the channel
      • jrm2k6 joined the channel
      • JesseH writes tip down.
      • jrm2k6
        Hi guys, I have a small question. Lets say I have a form, that I want to use to authenticate some users. When I click on the submit, I want to call a JS function which will call my authentication view. Is it something possible? Or do I have to call directly the view?
      • b0rsuk
        Credit goes to Jude Robinson and people from Hacker News who reported it. https://coderwall.com/p/oqtj8w
      • ojii|afk is now known as ojii
      • Nervosa
        jrm2k6: jquery post to a view, have it respond with whatever you want.
      • pejot has quit
      • jrm2k6
        Nervosa: I m using angular.js but I will check, thanks
      • FunkyBob
        Nervosa: !
      • Nervosa
        FunkyBob: Wut?
      • FunkyBob
        jrm2k6: it all looks the same to Django... a HTTP request is a HTTP request
      • jrm2k6
        ok good, thanks.
      • felix89 joined the channel
      • sayan joined the channel
      • freannrak joined the channel
      • Jax joined the channel
      • Jax
        hello
      • how do you get all Authors that have more than 0 books?
      • b0rsuk
        Apparently, if you use admin interface to add entries with a 'datetime' field, you can add entries with IDENTICAL datetime. (e1.created_at - e2.created.at == timedelta(0)). It happens if you do so in the same minute. This throws my 'prev_entry' and 'next_entry' methods off-balance. Any ideas how to amend tihs ?
      • codex0 joined the channel
      • FunkyBob
        Jax: Author.objects.filter(book__isnull=False)
      • jimyeh joined the channel
      • felix89 has quit
      • b0rsuk
        I could require 'created_at' to be unique, but this can lead to ugly side effects, including populating database with data from .json or .csv.
      • FunkyBob
        Jax: Author.objects.annotate(book_count=Count('book')).filter(book_count__gt=0)
      • felix89 joined the channel