#django

/

      • elyezer joined the channel
      • sartan
        i think i'm separating the superadmin and staff roles pretty well
      • the admin interface has so much code just neatly baked in already
      • e.g. calendar popups, error messages for blank fields
      • is there a way i can use some of the same wizardry without having to rewrite all of that code from scratch?
      • NicX joined the channel
      • assuming of course i'd write my own management console
      • jas02 joined the channel
      • elyezer joined the channel
      • Some published model-controller framework perhaps :)
      • schinckel
        sartan: You can just use class-based-views to get most of what you want.
      • ccbv.co.uk
      • jtiai
        And at this point I always favor to django-vanilla-views
      • Guddu has quit
      • Same thing as GCBV's but a cleaner model structure.
      • s/model/class/
      • sartan
        i'll check these out, thanks guys.
      • FunkyBob
        GCBV and ModelForms will do 90% of the work for you
      • schinckel
        jtiai: Did you see luke plant's post about his alternative to GCBV?
      • FunkyBob
        you should have learned abouy GCBV when you did the tutorial
      • jtiai
        schinckel: Nope.
      • schinckel
        I liked some of the ideas, but as I use CBV, I find more edge cases that don't fit into that simpler model.
      • sartan
        its not the /views/ i am really worried about
      • schinckel
        I should write a response to that.
      • sartan
        it's the /templating/
      • elyezer joined the channel
      • because, hell no. html and css and me don't play nice together.
      • hillaj has quit
      • i want to ignore the presentation layer as much as possible
      • schinckel
        Right after I finish my postures-tree-shootout series from last year.
      • hillaj joined the channel
      • GrahamDumpleton joined the channel
      • FunkyBob
        postures? posgres, surely?
      • schinckel
        postgres
      • FunkyBob
        postgres even
      • schinckel
        damn autocorrect
      • hah!
      • sartan
        i don't have a problem getting content to the user's browser, i just have a hard time making it look right, work well, and hadnling all the fiddly things. that's 50% template code and 60% css
      • I hope that makes sense
      • FunkyBob
        yeah, I leave that up to other people
      • elyezer_ joined the channel
      • front end work is not for me
      • Zeograd has quit
      • sartan
        we have a team of developers but they're all .net heads, i think dropping a small django templated app in front of them would raise an eyebrow or two
      • my only personal investment in this project right now is our entire workflow for firewall and software application approvals (security) is done in ms word, and it's an epic pain in the ass.
      • emails back and forth
      • elyezer_ has quit
      • elyezer joined the channel
      • i manage the security dept so i'm involved in a single email being passed around on average 6 times. doing it all in web = juicy.
      • so ugly+lazy = good
      • And in short, 'why sartan likes django-admin' :P
      • schinckel
        Oh, I love the admin.
      • hillaj has quit
      • I love it for how easy it makes doing model-based data entry when I'm still working on model structure.
      • sartan
        !! exactly
      • schinckel
        And how I can have access to a production environment to make a one-off change.
      • sartan
        speccing out these foreign keys takes seconds to validate
      • elyezer joined the channel
      • schinckel
        What it is _not_ is the tool I want to give my ops team to manage the system in an ongoing manner.
      • IMHO, only developers should have access to the admin. And perhaps only the most senior developer in production.
      • sartan
        isn't this why staff and superuser are seperated though?
      • staff = submit content, superuser = manage content
      • julienp_ joined the channel
      • schinckel
        Erm, not really.
      • superuser = do _anything_ (and everything)
      • sartan
        i also wanted to look at django-fsm instead of hard coding all the logic myself, but sadly no 1.8+ support =(
      • jaywink joined the channel
      • elyezer joined the channel
      • randomly changing topics
      • schinckel
        Haven't they updated that?
      • sartan
        last time i pulled it from pip it complained very loudly
      • schinckel
        They pulled in some of my ideas about proxy-model-state-machines.
      • Does it work, or just try to install an older django?
      • julienp has quit
      • julienp_ is now known as julienp
      • s/work/not work/
      • sartan
        well i'm still married to py 2.7, i figure i may as well move past 1.7 too
      • who wants to write last decades code every day
      • schinckel
        I'm still using 1.4 for my day job.
      • Django, not python.
      • dray3 joined the channel
      • I didn't start python until 1.5 ;)
      • sartan
        my day job has nothing to do with development, and much to do with 'lets install this and move on' so we can rely on things like yum install for dependancies and packages
      • though i have everything specced on virtualenv
      • elyezer joined the channel
      • schinckel
        Good start.
      • I even use pipsi (which installs into virtualenvs) for my installs like fabric/mercurial/etc
      • sartan
        it just makes it easier. i'm wondering if it's reasponable to expect me to actually deploy under virtualenv
      • schinckel
        We deploy into a virtualenv.
      • sartan
        i dont really know what people are doing in the wild
      • schinckel
        No reason _not_ to: there is no performance penalty - it's not like it's a virtual machine.
      • elyezer_ joined the channel
      • sartan
        i'm just thinking purely from deployment complexity
      • NicX
        Does anyone have a link to a fair comparison of CBV vs FBV? Is the decision to chose one over the other only about programming paradigm?
      • sartan
        if i had to hand this project off to some peon who doesn't know anything about python
      • MrBaboon joined the channel
      • schinckel
        The only things you need to worry about with virtualenv and deploying is that you (a) install packages into the virtualenv, and (b) use the virtualenv's python when running.
      • sartan
        i'm really enjoying bouncing my ideas off you guys, you're all nice :D
      • schinckel
        Also, maybe look into fabric for deployment, so you can make it easy for them to deploy.
      • fab deploy -R production
      • NicX: I often use both within the one project. Use a fbv until you need a cbv.
      • And then, use function_name = ViewClass.as_view() in the same file so you can swap in and out.
      • elyezer joined the channel
      • sartan
        sqlite of bust.
      • you're not the first this week to recommend fab
      • dshap has quit
      • NicX
        schnickel: sorry to press you, but what would be an example of when a FBV should become a CBV?
      • FunkyBob
        NicX: when you have a lot of shared code
      • elyezer joined the channel
      • sartan
        someone catch me up on the initalisms here? cbv, [assuming class based view], fbv [f... flow??] and gcbv ?
      • schinckel
        NicX: When you have lots of functionality that needs to be shared between them, that can't be moved into a function of it's own.
      • FunkyBob
        NicX: or are implementing something close to one of the common "generic" view patterns
      • sartan
        thinking gvbc is django.views.generic ?
      • FunkyBob
        schinckel: CBV == Class Based View, GCBV = Generic Class Based View, FBV = normal view function
      • khajvah joined the channel
      • schinckel
        In practice, my CBV are often extensions of GCBV. I'm not sure I have any _raw_ GCBV ones.
      • sartan
        i dont think i've ever used one of these fancy views
      • elyezer joined the channel
      • just do it the "hard way" i guess. looking into this
      • what is the difference between what i am reading on http://ccbv.co.uk and official django 1.8 documentation?
      • FunkyBob
        sartan: formatting, mostly
      • khajvah
        I don't see the point of CBVs
      • schinckel
        ccbv.co.uk is more of a reference.
      • sartan
        ahhh that makes much more sense.
      • elyezer_ joined the channel
      • khajvah: as opposed to what? (I think you've joined the tail end of a conversation)
      • these ccbv's seem all slated as if django was strictly a blog project =(
      • khajvah
        sartan: ah ok :)
      • elyezer joined the channel
      • Pheimors joined the channel
      • dray3 has quit
      • Pheimors
        have anyone use django-assets ?
      • elyezer joined the channel
      • I've set the STATICFIELS_FINDERS as said in the doc
      • naro joined the channel
      • but when I set static files path relative to my app static directory it can't find them
      • it seems that django-assets is trying to find them in a path relative to the current app :(
      • BlindHunter joined the channel
      • elyezer joined the channel
      • elyezer joined the channel
      • annefly joined the channel
      • bite has quit
      • sayan joined the channel
      • jas02 has quit
      • NicX
        Ultimately, does the decision to use CBV depend on your preferred paradigm? If OOP was your paradigm then I could see how CBV are appropriate for code reuse. Fortunately for me, Python is multi-paradigm and I really like declarative programming with higher order functions and have never found myself limited by FBV. However, I've been away from Django and Python for almost a year now and wonder if by going CBV from the start, I'll be "doing it
      • the right way".
      • hillaj joined the channel
      • elyezer_ joined the channel
      • donnex
        Hi, what is your recommended way to save model updates? I've got a user profile model with a update_last_browse() metod who sets a field to datetime.now() when run. Should I also run self.save() in this method or leave the .save() to be run where the method call is done? In my views for example?