*** tpb has joined #melange | 00:00 | |
*** dr__house has joined #melange | 03:12 | |
*** scorche has quit IRC | 03:54 | |
*** scorche` has joined #melange | 03:54 | |
*** scorche has joined #melange | 04:55 | |
*** scorche` has quit IRC | 04:55 | |
*** scorche has quit IRC | 05:07 | |
*** scorche has joined #melange | 05:07 | |
*** scorche has quit IRC | 05:10 | |
*** scorche has joined #melange | 05:10 | |
*** scorche has quit IRC | 05:41 | |
*** scorche has joined #melange | 06:09 | |
*** neo7 has joined #melange | 06:28 | |
*** madrazr has joined #melange | 07:17 | |
*** ChanServ sets mode: +v madrazr | 07:17 | |
*** madrazr has quit IRC | 08:09 | |
*** MatthewWilkes has joined #melange | 08:41 | |
*** madrazr has joined #melange | 09:20 | |
*** ChanServ sets mode: +v madrazr | 09:20 | |
*** madrazr has quit IRC | 09:23 | |
*** madrazr has joined #melange | 09:23 | |
*** ChanServ sets mode: +v madrazr | 09:23 | |
*** neo7 has quit IRC | 09:34 | |
*** neo7 has joined #melange | 09:36 | |
*** madrazr has quit IRC | 09:36 | |
*** madrazr1 has joined #melange | 09:36 | |
*** madrazr1 has quit IRC | 09:43 | |
*** neo7 has quit IRC | 09:58 | |
*** madrazr has joined #melange | 10:20 | |
*** ChanServ sets mode: +v madrazr | 10:20 | |
sttwister | SRabbelier: madrazr: can you help me a bit a please? I'm having troubles adding the check_access decorator to my views | 13:23 |
---|---|---|
madrazr | sttwister: yes ask away | 13:23 |
sttwister | this is the output: http://pastebin.com/D1LpfPBh | 13:24 |
tpb | Title: Environment: Request Method - Anonymous - D1LpfPBh - Pastebin.com (at pastebin.com) | 13:24 |
sttwister | so I guess it's not calling it with the right number of parameters | 13:25 |
*** sttwister_ has joined #melange | 13:26 | |
sttwister_ | sry I got d/c | 13:27 |
sttwister_ | my view is: def home(self, request, check_access, page_name=None, params=None, **kwargs): | 13:27 |
*** sttwister has quit IRC | 13:30 | |
madrazr | sttwister_: Ok | 13:33 |
madrazr | checking | 13:33 |
*** sttwister_ is now known as sttwister | 13:33 | |
madrazr | sttwister: can you please paste your rights dictionary? | 13:34 |
sttwister | I just did a "rights = access.DataSeederChecker(params)" | 13:35 |
sttwister | do I need to supply more details ? | 13:35 |
sttwister | I also tried things like "rights['home'] = ['checkIsDeveloper']" | 13:36 |
sttwister | not sure how this works exactly tbh | 13:36 |
sttwister | madrazr: ping | 13:38 |
madrazr | sttwister: yeah I understand | 13:38 |
madrazr | sttwister: it is actually overwhelming initially :D | 13:38 |
madrazr | sttwister: but yeah we are here to help you | 13:38 |
sttwister | madrazr: :) | 13:39 |
madrazr | sttwister: do I have a chance to look at your code? | 13:39 |
madrazr | sttwister: is it available somewhere? | 13:39 |
sttwister | madrazr: http://code.google.com/r/sttwister-gsoc2010/source/browse/app/soc/modules/seeder/views/seeder.py | 13:40 |
tpb | <http://ln-s.net/7-vz> (at code.google.com) | 13:40 |
madrazr | sttwister: seeing | 13:45 |
madrazr | sttwister: this is the code that is throwing up errors? | 13:45 |
sttwister | yep, I just added check_access decorator to any of the views | 13:45 |
sttwister | and the access_type parameter to the function definition | 13:45 |
madrazr | sttwister: cool! | 13:46 |
madrazr | sttwister: if you add a check_access decorator | 13:46 |
madrazr | you need to write "Rights" definition for that view | 13:46 |
madrazr | sttwister: let me fetch some samples for you | 13:46 |
madrazr | sttwister: just a side note. Code reading is always the awesomest exercise for a developer | 13:47 |
madrazr | I keep telling this almost every day to Savitha too :) | 13:47 |
sttwister | madrazr: cool, thanks | 13:47 |
sttwister | madrazr: heh, yes indeed it is | 13:47 |
madrazr | sttwister: searching for samples | 13:47 |
madrazr | and pointers ... | 13:47 |
madrazr | sttwister: http://code.google.com/p/soc/source/browse/app/soc/modules/ghop/views/models/task.py | 13:49 |
tpb | <http://ln-s.net/7-wJ> (at code.google.com) | 13:49 |
madrazr | sttwister: http://code.google.com/p/soc/source/browse/app/soc/modules/ghop/views/models/task.py#718 | 13:49 |
tpb | <http://ln-s.net/7-wL> (at code.google.com) | 13:49 |
madrazr | I have this method called listOrgTasks for example | 13:49 |
madrazr | sttwister: for this I define the access name as list_org_tasks here http://code.google.com/p/soc/source/browse/app/soc/modules/ghop/views/models/task.py#1435 | 13:50 |
tpb | <http://ln-s.net/7-wM> (at code.google.com) | 13:50 |
madrazr | rather access_type | 13:50 |
madrazr | sttwister: this is used in URL Pattern too | 13:50 |
madrazr | http://code.google.com/p/soc/source/browse/app/soc/modules/ghop/views/models/task.py#204 | 13:50 |
tpb | <http://ln-s.net/7-wN> (at code.google.com) | 13:50 |
madrazr | sttwister: and I have an access check rule written for it here for that access type | 13:51 |
madrazr | http://code.google.com/p/soc/source/browse/app/soc/modules/ghop/views/models/task.py#164 | 13:51 |
tpb | <http://ln-s.net/7-wO> (at code.google.com) | 13:51 |
madrazr | sttwister: getting ideas? | 13:51 |
sttwister | madrazr: cool, well I figured it should be something like that | 13:51 |
sttwister | madrazr: I did everything you mentioned, except for the url pattern | 13:52 |
madrazr | sttwister: did you add rights['<access_type>'] too? | 13:52 |
sttwister | madrazr: guess that's why it's not including the access_type parameter and raising that exception | 13:52 |
madrazr | the rule for access check? | 13:52 |
madrazr | sttwister: yeah of course :) | 13:52 |
sttwister | madrazr: yep, I did that | 13:53 |
sttwister | madrazr: ok, so my pattern looks like this '^%(url_name)s/(?P<access_type>home)$' | 13:55 |
sttwister | url_name is 'seeder' | 13:55 |
sttwister | I get another error | 13:56 |
sttwister | because 'js_uses_all' is not in self._params :/ | 13:56 |
madrazr | sttwister: that is weird | 13:57 |
madrazr | are you using it the same way other views are using it? | 13:57 |
madrazr | sttwister: have you read other views code? | 13:57 |
sttwister | madrazr: well, it's a bit more tricky | 13:58 |
sttwister | madrazr: because my view is not tied to a model like I said... so I'm not using the constructParams helper function | 13:58 |
sttwister | madrazr: I guess that's causing some things to break | 13:58 |
madrazr | sttwister: Oh | 14:00 |
madrazr | sttwister: I need to read more of your code then | 14:01 |
madrazr | sttwister: could you override constructParams to use only what you want? | 14:01 |
sttwister | madrazr: yep probably, that should also be the long term solution | 14:02 |
madrazr | sttwister: nothing pops out of my head for a short term solution though :( | 14:05 |
madrazr | sttwister: may be when SRabbelier is around you can ping him about this, don't be discouraged, I am just not able to get anything immediately | 14:05 |
sttwister | madrazr: ok, sure, thanks | 14:05 |
*** madrazr has quit IRC | 15:17 | |
*** madrazr has joined #melange | 16:35 | |
*** ChanServ sets mode: +v madrazr | 16:35 | |
*** sttwister has quit IRC | 16:39 | |
*** dhaun has joined #melange | 17:17 | |
*** MatthewWilkes has quit IRC | 17:26 | |
*** sttwister has joined #melange | 18:01 | |
*** dr__house has quit IRC | 18:53 | |
*** harlan_ is now known as harlan | 19:23 | |
*** harlan has quit IRC | 19:23 | |
*** harlan has joined #melange | 19:23 | |
*** madrazr has quit IRC | 21:12 | |
*** dhaun has quit IRC | 21:23 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!