#django

/

      • H25 has quit
      • Sewar
        Hi, using CreateView, how to get all arguments from urlconf?
      • BiskitB0y has quit
      • mattmcc
        self.kwargs
      • maximilianoo joined the channel
      • knite joined the channel
      • pierre1 joined the channel
      • Sewar
      • moculrz has quit
      • moculrz joined the channel
      • powellc
        Sewar: I believe that you wont have kwargs in __init__
      • jstump has quit
      • mwmnj joined the channel
      • try using an action funciton like: def get(self, request, *args, **kwargs) or def post
      • s/funciton/function
      • natea has quit
      • polishnorbi has quit
      • mattmcc
        Sewar: It's pretty uncommon that you'll have a reason to override a view class's constructor. And request-time arguments aren't yet initialized at that point.
      • powellc
        Right, try using def get_initial(self):
      • mattmcc
        Or better yet, tell us what your actual question is.
      • powellc
        haha, touche
      • Sewar
        I'm have a pk in url, the new object should be related to that when created
      • s/I'm/I
      • it
      • it's different model than the one being created/updated
      • mattmcc
        So form_valid is probably a good place to do that.
      • Sewar
        I need that before form_valid, some stuff in the form page depend on the parent model data
      • knite has quit
      • FunkyBob
        sounds to me like using a CBGV is only making your life hard
      • mattmcc
        What sort of stuff?
      • lightstrike has quit
      • Sewar
        form validation
      • powellc
        FunkyBob: And whose life is not made hard by CBGV? ;)
      • mattmcc
        So you'll want to pass the object into the form, get_form_kwargs (and write your form constructor to accept the extra argument)
      • powellc
        just kidding ... I know there are valid use cases
      • lightstrike joined the channel
      • FunkyBob
        powellc: sure, just nowhere near as many as cases they are used :P
      • powellc
        hehe, +1
      • Sewar
        mattmcc: that sounds like the perfect solution, thanks
      • thanks guys
      • powellc
        I'm actually staring at some code of mine where I overrode the dispatch method on a CreateView ... at that point you might as well use functions :)
      • mattmcc
        Eh, it depends.
      • powellc
        There is definitely merit in being able to inherit other views and build up some complex use cases, I've enjoyed that benefit quite a bit
      • FunkyBob
        my last feature branch removed yet another CBV use
      • and, as usual, the code became simpler, clearer, and _shorter_
      • powellc
        So just curious, has anyone brought a 1.4 or older project up to 1.5?
      • mwmnj has quit
      • juliaelman has quit
      • fission6 has quit
      • skeet70
        powellc I have not, but I'd be interested in the answer. Stuck on 1.3 still because of budget concerns.
      • FunkyBob
        powellc: I have
      • sudobangbang has quit
      • mattmcc
        powellc: Just read through all the changes noted in the release notes.
      • powellc
        haha, yeah, it's the template tags that are the doozy for us
      • FunkyBob
        most of the work was adjusting {% url %} tags, url imports.... not much else
      • powellc
        Our problem is that we're an agency with a number of fairly subtantial codebases, and, like skeet70, a lack of budget
      • FunkyBob
        powellc: how so?
      • oh, and my code derived from InheritanceManager had to change
      • mattmcc
        powellc: Well, take advantage of 'load url from future' first, so that you don't have to do a version upgrade.
      • powellc
        yeah, don't have the benefit on the older codebases (1.3 and older) but with newer projects that certainly helps
      • Of course, part of that pain is not managing client expectations for how long their sites should go without a refactoring ... still supporting one client on 1.1
      • Dex26354 has quit
      • *sigh*
      • diphtherial
        sigh indeed
      • FunkyBob
        I'm about to run up another VM... and _really_ want to migrate all my existing clients onto it from my other 2
      • and update/refresh them all in the process
      • powellc
        Yeah, with our newer clients too, tox plus test coverage makes the switch much easier too ... just toss 1.5 in as another piece to test and fix until it passes
      • FunkyBob
        yeah
      • all of mine were cheapo sites...
      • powellc
        if only ... :)
      • FunkyBob
        generally running on my own CMS app {gnocchi-cms}
      • powellc
        delicious
      • FunkyBob
        so there's really no money in it for me to do work on them
      • powellc
        right
      • FunkyBob
        but consolidating versions, and migrating everything to BCP... that's worth it
      • really really must find time to get to work on salsa, my next gen cms
      • am ver tempted to make it use django-cte-trees
      • powellc
        neat, wasn't aware of cte-trees, that's slick
      • FunkyBob
        aye
      • powellc
        I've grown disillusioned with CMS apps as of late ... but its so hard to convince a client to structure their site around data instead of pages (and sometimes that's just not possible)
      • jstump joined the channel
      • Doesn't help that we've been using django-cms heavily ... great piece of OSS work, but man, don't you dare try to get your page data out of that database :)
      • FunkyBob
        eh?
      • basically, I was trying to abstract gnocchi-cms one step further..
      • powellc
        django-cms just really fragments the page data, so the titles are in their own table, related to the page an then everything on the page is a plugin, so there are separate tables for each plugin type and so on
      • gnocchi seems pretty simply laid out though ... and I like the templates in the DB idea
      • FunkyBob
        sounds a little like where I was heading
      • endra has quit
      • yeah... gnocchi had some very specific goals-- one of which is "work within admin"
      • powellc
        hehe, sorry
      • FunkyBob
        well, the Fragments on Pages were nice, but I wanted to go one step further
      • and let you share arbitrary content things across pages...
      • so I was going to turn Fragments into a tab/slot idea
      • as well as mark up templates with {% slot %} tags...
      • powellc
        Yeah, and that's neat ... django-cms doesn't let you share plugins across pages
      • MarbinDrakon joined the channel
      • so you have fragmentation for fragmentations-sake, it seems
      • FunkyBob
        however, this is all for salsa.... and salsa would most certainly NOT use Admin
      • powellc
        well, not really, there are use cases for plugins on pages, but it does make a mess of the DB
      • voidus joined the channel
      • voidus is now known as void
      • I actually like the idea of reusable slots
      • FunkyBob
        so when editing a Page, you select its Template, and then the console can scan that template and find what {% slot %}s are defined on it
      • ajw0100 has quit
      • then it can hint at what named fragment slots you should fill in
      • flaviodesousa joined the channel
      • alo, gnocchi pages have no way to deal with posts...
      • but I figured a nice clean way to fix that for salsa
      • however... I've not had experience with other CMSs .. much.... and don't know how people really interact with them...
      • Milossh has quit
      • and every time I find someone who's willing to contribute their experience... they vanish :/
      • powellc
        yeah, that's too bad
      • FunkyBob
        but I think I'm going to resurrect salsa... and go with my simple, direct idea
      • tricky part, now, will be building the UI :P
      • powellc
        yah, good luck not using admin :)
      • FunkyBob
        well, I've been looking for a project to try out w2ui on
      • knightshade2 joined the channel
      • johnnysparkles has quit
      • powellc
        yeah, that's pretty slick
      • flaviodesousa has quit
      • zauberpony has quit
      • zauberpony joined the channel
      • Milossh joined the channel
      • knightshade has quit
      • heaven_ has quit
      • jstump has quit
      • rideh has quit
      • epicowl joined the channel
      • maximilianoo has quit
      • mayhew has quit
      • mkoistinen joined the channel
      • macgregor joined the channel
      • macgregor has left the channel
      • jayant__ has quit
      • epicowl has quit
      • rideh joined the channel
      • joshfinnie has quit
      • mkoistinen has quit
      • hoot joined the channel
      • sohail has quit
      • jarshwah has quit
      • jarshwah joined the channel
      • rideh has quit
      • Dex26354 joined the channel
      • TeeTime joined the channel
      • arturrro joined the channel
      • proteusguy joined the channel
      • Dex26354 has quit
      • Goopyo joined the channel
      • luyikei__ joined the channel