*** tpb has joined #timvideos | 00:00 | |
*** flavioribeiro has quit IRC | 01:09 | |
*** CarlFK has quit IRC | 01:10 | |
*** CarlFK has joined #timvideos | 02:01 | |
*** ChanServ sets mode: +v CarlFK | 02:01 | |
*** hyades has quit IRC | 02:13 | |
*** hyades has joined #timvideos | 02:46 | |
*** Niharika has joined #timvideos | 03:14 | |
*** CarlFK has quit IRC | 03:20 | |
*** CarlFK has joined #timvideos | 03:26 | |
*** ChanServ sets mode: +v CarlFK | 03:26 | |
*** Niharika has quit IRC | 03:56 | |
*** CarlFK has quit IRC | 04:27 | |
*** CarlFK has joined #timvideos | 04:52 | |
*** ChanServ sets mode: +v CarlFK | 04:52 | |
aps | A django class based views doubt here. How do I call another view from inside a view depending on if user is_staff? | 05:40 |
---|---|---|
aps | Basically, I wish to call different views for same URL, depending upon if user is staff or not. | 05:40 |
CarlFK | um.. that seems like an odd wish | 05:45 |
CarlFK | URLs map to views, so have 1 view that starts out request.user.is_staff(): | 05:46 |
aps | yes | 05:46 |
aps | CarlFK: here is what I have currently - http://paste.ubuntu.com/8957037/ - I don't know if and what method I need to write inside WorkRedirectView | 05:49 |
tpb | Title: Ubuntu Pastebin (at paste.ubuntu.com) | 05:49 |
CarlFK | ah.. I kinda see what you are trying to do... I have one comment: | 05:53 |
CarlFK | line 3 if self.request.user.is_staff: | 05:54 |
CarlFK | that 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 |
aps | I believe I need to write all that inside a get method? | 05:56 |
CarlFK | thats what I was thinking. | 05:57 |
aps | or dispatch? | 05:57 |
CarlFK | du no. I have always just used functions, or maybe class based generic views, so no logic at all | 05:59 |
aps | I ended up writing a FBV that returns required CBV | 06:28 |
*** Niharika has joined #timvideos | 06:34 | |
*** slomo has joined #timvideos | 08:19 | |
*** slomo has joined #timvideos | 08:19 | |
*** flavioribeiro has joined #timvideos | 08:30 | |
*** Niharika has quit IRC | 09:03 | |
*** scrollback1 has quit IRC | 10:11 | |
*** 7GHAALOKT has joined #timvideos | 10:13 | |
*** Niharika has joined #timvideos | 12:30 | |
*** Niharika has joined #timvideos | 12:30 | |
*** Niharika has quit IRC | 13:29 | |
*** Niharika has joined #timvideos | 13:30 | |
*** rohitksingh has joined #timvideos | 14:34 | |
*** cfelton_ is now known as cfelton | 15:46 | |
*** flaviori_ has joined #timvideos | 17:11 | |
*** flavioribeiro has quit IRC | 17:14 | |
*** tariq786_lab is now known as tariq786 | 17:15 | |
*** jmc75 has joined #timvideos | 17:30 | |
*** slomo has quit IRC | 18:15 | |
*** slomo has joined #timvideos | 18:20 | |
*** slomo has joined #timvideos | 18:20 | |
*** flaviori_ has quit IRC | 18:37 | |
*** Niharika has quit IRC | 18:37 | |
*** rohitksingh has quit IRC | 19:28 | |
*** flavioribeiro has joined #timvideos | 20:22 | |
*** hyades has quit IRC | 20:53 | |
*** slomo has quit IRC | 21:27 | |
*** jmc75 has quit IRC | 23:08 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!