Wednesday, 2014-11-12

*** tpb has joined #timvideos00:00
*** flavioribeiro has quit IRC01:09
*** CarlFK has quit IRC01:10
*** CarlFK has joined #timvideos02:01
*** ChanServ sets mode: +v CarlFK02:01
*** hyades has quit IRC02:13
*** hyades has joined #timvideos02:46
*** Niharika has joined #timvideos03:14
*** CarlFK has quit IRC03:20
*** CarlFK has joined #timvideos03:26
*** ChanServ sets mode: +v CarlFK03:26
*** Niharika has quit IRC03:56
*** CarlFK has quit IRC04:27
*** CarlFK has joined #timvideos04:52
*** ChanServ sets mode: +v CarlFK04:52
apsA django class based views doubt here. How do I call another view from inside a view depending on if user is_staff?05:40
apsBasically, I wish to call different views for same URL, depending upon if user is staff or not.05:40
CarlFKum.. that seems like an odd wish05:45
CarlFKURLs map to views, so have 1 view that starts out request.user.is_staff():05:46
apsyes05:46
apsCarlFK: here is what I have currently - http://paste.ubuntu.com/8957037/ - I don't know if and what method I need to write inside WorkRedirectView05:49
tpbTitle: Ubuntu Pastebin (at paste.ubuntu.com)05:49
CarlFKah.. I kinda see what you are trying to do... I have one comment:05:53
CarlFKline 3    if self.request.user.is_staff:05:54
CarlFKthat gets executed as part of the class being defined (when the .py is imported by another .py) , not instantiated as an object (o = WorkRedirectView(request)  (I am assuming request gets passed like that)05:56
apsI believe I need to write all that inside a get method?05:56
CarlFKthats what I was thinking.05:57
apsor dispatch?05:57
CarlFKdu no.  I have always just used functions, or maybe class based generic views, so no logic at all05:59
apsI ended up writing a FBV that returns required CBV06:28
*** Niharika has joined #timvideos06:34
*** slomo has joined #timvideos08:19
*** slomo has joined #timvideos08:19
*** flavioribeiro has joined #timvideos08:30
*** Niharika has quit IRC09:03
*** scrollback1 has quit IRC10:11
*** 7GHAALOKT has joined #timvideos10:13
*** Niharika has joined #timvideos12:30
*** Niharika has joined #timvideos12:30
*** Niharika has quit IRC13:29
*** Niharika has joined #timvideos13:30
*** rohitksingh has joined #timvideos14:34
*** cfelton_ is now known as cfelton15:46
*** flaviori_ has joined #timvideos17:11
*** flavioribeiro has quit IRC17:14
*** tariq786_lab is now known as tariq78617:15
*** jmc75 has joined #timvideos17:30
*** slomo has quit IRC18:15
*** slomo has joined #timvideos18:20
*** slomo has joined #timvideos18:20
*** flaviori_ has quit IRC18:37
*** Niharika has quit IRC18:37
*** rohitksingh has quit IRC19:28
*** flavioribeiro has joined #timvideos20:22
*** hyades has quit IRC20:53
*** slomo has quit IRC21:27
*** jmc75 has quit IRC23:08

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!