Commits

Thomas Johansson  committed 86c4976

Rename get_*_from_* to get_*_for_*.

  • Participants
  • Parent commits 39d8cd8

Comments (0)

Files changed (4)

File piston/authentication/oauth/__init__.py

         if not verify_oauth_request(request, oauth_request, consumer, access_token):
             return False
 
-        request.user = store.get_user_from_access_token(request, oauth_request, access_token)
-        request.consumer = store.get_consumer_from_access_token(request, oauth_request, access_token)
+        request.user = store.get_user_for_access_token(request, oauth_request, access_token)
+        request.consumer = store.get_consumer_for_access_token(request, oauth_request, access_token)
         request.throttle_extra = request.consumer.key
 
         return True

File piston/authentication/oauth/store/__init__.py

     instance it itself returned at an earlier stage from one of the methods that
     take a key and return a Consumer or Token. This means if your store
     implementation uses tokens that keep a reference to its Consumer on the
-    Token itself, `get_consumer_from_request_token` can simply return
+    Token itself, `get_consumer_for_request_token` can simply return
     `request_token.consumer`.
     """
     def get_consumer(self, request, oauth_request, consumer_key):
         """
         raise NotImplementedError
     
-    def get_consumer_from_request_token(self, request, oauth_request, request_token):
+    def get_consumer_for_request_token(self, request, oauth_request, request_token):
         """
         Return the Consumer associated with the `request_token` Token, or raise
         `InvalidConsumer`.
         """
         raise NotImplementedError
     
-    def get_consumer_from_access_token(self, request, oauth_request, access_token):
+    def get_consumer_for_access_token(self, request, oauth_request, access_token):
         """
         Return the Consumer associated with the `access_token` Token, or raise
         `InvalidConsumer`.
         """
         raise NotImplementedError
 
-    def get_user_from_access_token(self, request, oauth_request, access_token):
+    def get_user_for_access_token(self, request, oauth_request, access_token):
         """
         Return the associated User for `access_token`.
         

File piston/authentication/oauth/store/db.py

         except Consumer.DoesNotExist:
             raise InvalidConsumer
 
-    def get_consumer_from_request_token(self, request, oauth_request, request_token):
+    def get_consumer_for_request_token(self, request, oauth_request, request_token):
         return request_token.consumer
 
-    def get_consumer_from_access_token(self, request, oauth_request, access_token):
+    def get_consumer_for_access_token(self, request, oauth_request, access_token):
         return access_token.consumer
 
     def create_request_token(self, request, oauth_request, consumer, callback):
         except Token.DoesNotExist:
             raise InvalidAccessToken
 
-    def get_user_from_access_token(self, request, oauth_request, access_token):
+    def get_user_for_access_token(self, request, oauth_request, access_token):
         return access_token.user
 
     def check_nonce(self, request, oauth_request, nonce):

File piston/authentication/oauth/views.py

 
     oauth_request = get_oauth_request(request)
     request_token = store.get_request_token(request, oauth_request, request.REQUEST['oauth_token'])
-    consumer = store.get_consumer_from_request_token(request, oauth_request, request_token)
+    consumer = store.get_consumer_for_request_token(request, oauth_request, request_token)
     
     if request.method == 'POST':
         form = form_class(request.POST)