#django

/

      • graingert joined the channel
      • schinckel
        I have something similar, for a project that has similar model types to yours... ;)
      • WillisMa1
        schinckel: So you're suggesting the cache approach?
      • mattmcc
        Storing (denormalizing) the numbers is certainly worth looking at, but I wouldn't do it in Django, I'd do it in your database.
      • Materialized views are great for this.
      • Whether or not a regular view would do well depends on how costly the calculations are.
      • SDCDev joined the channel
      • buscon joined the channel
      • agaral is now known as rhaps0dy
      • merb joined the channel
      • schinckel
        Yeah, I was suggesting a regular view, and if that's too slow, then try a materialised view.
      • merb has left the channel
      • sebcorbin is now known as sebcorbin`away
      • graingert has quit
      • Gagaro
        Hi, I have a question about setUpTestData
      • There something I think I misunderstood about it
      • rhaps0dy is now known as agaral
      • agaral is now known as adgral
      • Are the data created in it shared by all tests and not rollbacked after each test ?
      • denys joined the channel
      • grumpi has quit
      • I thought there would be a rollback after eevery test but it seems the data stays modified between each one
      • The documentation isn't very clear about it
      • ichag joined the channel
      • FunkyBob
        I would exepct it to be shared for all tests
      • but each tests changes are rolled back
      • Gagaro
        That's the issue I have, the changes aren't rolled back
      • I have `cls.order.go_suspended()` in setUpTestData
      • and `self.order.go_completed()` in the first test
      • And the order is completed in every other test
      • Ergo^ joined the channel
      • I'm using postgresql
      • FunkyBob
        dpaste your code?
      • Gagaro
        So it should support rollback,
      • greydawg has quit
      • It's a big test case, let me try to reproduce it in a smaller one
      • buscon has quit
      • rahulrrixe has quit
      • benoitbb joined the channel
      • test_2 fails
      • Maybe is it because of WebTest ?
      • shangxiao joined the channel
      • It still doesn't work with TestCase
      • kakulukia joined the channel
      • FunkyBob: I simplified the tests: https://dpaste.de/CJxP
      • kakulukia
        hi
      • graingert joined the channel
      • Gagaro
        hi
      • the_drow joined the channel
      • kakulukia
        is there a way of looking at a generated migration and see exactly what change and caused the migration to be generated? i mean adding and deleting fields is kinda obvious, but filed alterations aint :/
      • Gagaro
        You can look at the migration file directly
      • in the migrations folder
      • kakulukia
        ist just listing the changed field, but not the the reason why its changed
      • kezabelle1
        if you changed anything about the field, that's why it changed :)
      • kakulukia
        id like to be able to see the old version
      • kezabelle1
        open the previous migration that touched it.
      • kakulukia
        id like to do what someone else did to the filed and did not generate migrations for
      • *see not do
      • Gagaro
        You have a field which generates a migration but you aren't the one who changed this field ?
      • Are you using git ?
      • adgral is now known as rhaps0dy
      • kakulukia
        great idea!
      • kaakku joined the channel
      • i was just hoping to be able to use the migration itself since django also has to know what changed and still is not inside any migration
      • Gagaro
        I don't know if you can do it with juste the migration commands
      • kakulukia
        thx anyway
      • Gagaro
        git blame and blame your colleague for not doing the migration then :D
      • ciurkut joined the channel
      • kakulukia
        will do! :D
      • nordica joined the channel
      • isthisreallife joined the channel
      • isthisreallife
        how in django admin can i display only posts that have active=True ?
      • mattmcc
        isthisreallife: list_filter = ['active']
      • minot1 joined the channel
      • svetlana joined the channel
      • garrypolley joined the channel
      • svetlana
        Hi. https://github.com/qubird/django-chatrooms contains wrong instructions, or I can't spell? http://dpaste.com/2WE6V64
      • kakulukia
        or if u never what to see those other posts, overwrite get_queryset on the admin and filter it out for good
      • zesantos joined the channel
      • *want
      • jMyles joined the channel
      • WillisMa1
        mattmcc: So, https://github.com/chrisspen/django-materialize... has to be called manually. Is there anyway I can reliably be informed whenever a Model / Table gets updated? Would using https://gist.github.com/mattmcc/5250561 and replacing with super() and firing a signal an awful idea?
      • mattmcc: In my case I'd ideally like the cached table to be always up to date.
      • grumpi joined the channel
      • FunkyBob
        heh
      • WillisMa1
        Otherwise users will be making stuff / ordering stuff and assuming it didn't work.
      • When the cache is a 30 seconds off
      • FunkyBob
        WillisMa1: welcome to one of the 2 hard problems in CS
      • WillisMa1
        damnit
      • kaakku
        svetlana, Seems to work fine for me.
      • FunkyBob
        Cache invalidation, naming things, and off-by-one errors.
      • mossplix joined the channel
      • garrypolley has quit
      • svetlana
        kaakku: hm. how should I troubleshoot it, then?
      • WillisMa1
        FunkyBob: That's at leats two off the list then: https://dpaste.de/ns18
      • shangxiao
        svetlana: which version of pip do you have?
      • i seem to remember having trouble installing alphas with older versions of pip
      • gelbander joined the channel
      • jMyles has quit
      • lol FunkyBob: my favourite cs joke
      • k_sze[work] joined the channel
      • isthisreallife
        hmm
      • list_filter doesnt work with methods?
      • Dominee joined the channel
      • svetlana
        shangxiao: 1.5.6 (python 2.7)
      • brxs has quit
      • k_sze[work]
        hmm, where have I seen this before? "DateTimeField FakeModel.creation_time received a naive datetime"
      • shangxiao
        svetlana: that's pretty old :)
      • k_sze[work]
        I think it during migrations?
      • shangxiao
        7.0.1 is the current
      • svetlana: run pip install --upgrade pip
      • nordica has quit
      • isthisreallife
      • okay how to fix it
      • brxs joined the channel
      • list_filter doersnt work with methods?
      • capella-da-star joined the channel
      • ohrstrom joined the channel
      • i need to display subpages that flag is set to 'genaral'
      • mattmcc ^
      • ciurkut
        erm, if my search gets 14req/s on postgres 45 on elastic with haystack, and 150 on pure html am i doing something wrong or is it okay? xd
      • FunkyBob
        ciurkut: you're comparing incomparable things?
      • schinckel
        isthisreallife: You can use methods, but you need to do extra work.
      • Also, remember that the admin isn't your site.
      • ciurkut
        FunkyBob, always... :c
      • jtiai
        isthisreallife: Filter, as name suggest can only filter things.
      • Lipp joined the channel
      • isthisreallife
        schinckel, please show me how to do it? some code samples?
      • schinckel
        (But obviously there needs to be something in the database to filter upon)
      • FunkyBob
        ciurkut: how can you "search" in "pure html"?
      • ciurkut
        im just asking that if my serv on my dev machine spits out 150req/s html and 44 elastic, is that kinda okay or should i expect something more like 100req/s
      • jtiai
        isthisreallife: So you can add rules to filter but you can't just return totally new queryset.
      • schinckel
      • ciurkut
        its not search, that pure html has no logic
      • ramsub07 has quit
      • its just stub to test how much req/s my serv can actually handle without db stuff/template rendering object using etc
      • one template no images no heavy stuff
      • Lipp has quit
      • jtiai
        ciurkut: Django may actually hit db, like to fetch session for example.
      • FunkyBob
      • ciurkut: that managed 463r/s
      • ciurkut
        FunkyBob, is it html or rendering of dem stuff? :c
      • FunkyBob
        am quite sure that was rendering the front page of my blog [at the time] so it includes DB hits
      • of course, neitherr of us has mentioned the hardware used in the test, or the test options used, etc
      • lukasa_home joined the channel
      • doismellburning
        lukasa_home: o/
      • lukasa_home
        o/
      • I successfully something something nickserv
      • ciurkut
        FunkyBob, you do have blog? :v