Changeset 2954

Show
Ignore:
Timestamp:
02/22/07 18:46:30 (2 years ago)
Author:
mscott
Message:

Convert extent_queries and extent_transactions to extent_q_methods and extent_t_methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/config/routing.py

    r2953 r2954  
    3131                 ) 
    3232     
    33     map.resource('query', 'queries', 
    34                  controller='extent_queries', 
     33    map.resource('entity', 'entities', 
     34                 path_prefix='/databases/:db_id/extents/:extent_id', 
     35                 ) 
     36     
     37    map.resource('q_method', 'q_methods', 
     38                 controller='extent_q_methods', 
    3539                 path_prefix='/databases/:db_id/extents/:extent_id', 
    3640                 name_prefix='extent_', 
     
    3842                 ) 
    3943 
    40     map.resource('transaction', 'transactions', 
    41                  controller='extent_transactions', 
     44    map.resource('t_method', 't_methods', 
     45                 controller='extent_t_methods', 
    4246                 path_prefix='/databases/:db_id/extents/:extent_id', 
    4347                 name_prefix='extent_', 
     
    4549                 ) 
    4650                  
    47     map.resource('entity', 'entities', 
    48                  path_prefix='/databases/:db_id/extents/:extent_id', 
    49                  ) 
    50      
    5151    map.connect(':controller/:action/:id') 
    5252    map.connect('*url', controller='template', action='view') 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_q_methods.py

    r2938 r2954  
    22 
    33 
    4 class ExtentQueriesController(BaseController): 
     4class ExtentQMethodsController(BaseController): 
    55    """REST Controller styled on the Atom Publishing Protocol""" 
    66    # To properly map this controller, ensure your config/routing.py file has 
    77    # a resource setup: 
    8     #     map.resource('extent_query', 'extent_queries') 
     8    #     map.resource('extent_q_method', 'extent_q_methods') 
    99 
    1010    def index(self, db_id, extent_id, format='html'): 
    1111        """GET /: All items in the collection.""" 
    12         # url_for('extent_queries') 
     12        # url_for('extent_q_methods') 
    1313        c.dbs = dbs = self.dbs 
    1414        c.db_id = db_id 
    1515        c.db = db = dbs[db_id] 
    1616        c.extent = db.extent(extent_id) 
    17         return render_response('/extent_queries/index.html') 
     17        return render_response('/extent_q_methods/index.html') 
    1818     
    1919    def call(self, db_id, extent_id, id): 
    2020        """POST /id;call: Call the query method.""" 
    21         # url_for('extent_call_query', id=ID) 
     21        # url_for('extent_call_q_method', id=ID) 
    2222        db = self.dbs[db_id] 
    2323        extent = db.extent(extent_id) 
     
    3131    def create(self): 
    3232        """POST /: Create a new item.""" 
    33         # url_for('extent_queries') 
     33        # url_for('extent_q_methods') 
    3434        pass 
    3535     
    3636    def new(self, format='html'): 
    3737        """GET /new: Form to create a new item.""" 
    38         # url_for('new_extent_query') 
     38        # url_for('new_extent_q_method') 
    3939        pass 
    4040     
     
    4444        #    <input type="hidden" name="_method" value="PUT" /> 
    4545        # Or using helpers: 
    46         #    h.form(h.url_for('extent_query', id=ID), method='put') 
    47         # url_for('extent_query', id=ID) 
     46        #    h.form(h.url_for('extent_q_method', id=ID), method='put') 
     47        # url_for('extent_q_method', id=ID) 
    4848        pass 
    4949     
     
    5353        #    <input type="hidden" name="_method" value="DELETE" /> 
    5454        # Or using helpers: 
    55         #    h.form(h.url_for('extent_query', id=ID), method='delete') 
    56         # url_for('extent_query', id=ID) 
     55        #    h.form(h.url_for('extent_q_method', id=ID), method='delete') 
     56        # url_for('extent_q_method', id=ID) 
    5757        pass 
    5858     
    5959    def show(self, db_id, extent_id, id, format='html'): 
    6060        """GET /id: Show a specific item.""" 
    61         # url_for('extent_query', id=ID) 
     61        # url_for('extent_q_method', id=ID) 
    6262        c.dbs = dbs = self.dbs 
    6363        c.db_id = db_id 
     
    6666        c.method = c.extent.q[id] 
    6767        c.method_id = id 
    68         return render_response('/extent_queries/show.html') 
     68        return render_response('/extent_q_methods/show.html') 
    6969     
    7070    def edit(self, id, format='html'): 
    7171        """GET /id;edit: Form to edit an existing item.""" 
    72         # url_for('edit_extent_query', id=ID) 
     72        # url_for('edit_extent_q_method', id=ID) 
    7373        pass 
    7474     
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extent_t_methods.py

    r2938 r2954  
    22 
    33 
    4 class ExtentTransactionsController(BaseController): 
     4class ExtentTMethodsController(BaseController): 
    55    """REST Controller styled on the Atom Publishing Protocol""" 
    66    # To properly map this controller, ensure your config/routing.py file has 
    77    # a resource setup: 
    8     #     map.resource('extent_transaction', 'extent_transactions') 
     8    #     map.resource('extent_t_method', 'extent_t_methods') 
    99 
    1010    def index(self, db_id, extent_id, format='html'): 
     
    1414        c.db = db = dbs[db_id] 
    1515        c.extent = db.extent(extent_id) 
    16         return render_response('/extent_transactions/index.html') 
     16        return render_response('/extent_t_methods/index.html') 
    1717     
    1818    def call(self, db_id, extent_id, id): 
    1919        """POST /id;call: Call the transaction method.""" 
    20         # url_for('extent_call_transaction', id=ID) 
     20        # url_for('extent_call_t_method', id=ID) 
    2121        db = self.dbs[db_id] 
    2222        extent = db.extent(extent_id) 
     
    3030    def create(self): 
    3131        """POST /: Create a new item.""" 
    32         # url_for('extent_transactions') 
     32        # url_for('extent_t_methods') 
    3333        pass 
    3434     
    3535    def new(self, format='html'): 
    3636        """GET /new: Form to create a new item.""" 
    37         # url_for('new_extent_transaction') 
     37        # url_for('new_extent_t_method') 
    3838        pass 
    3939     
     
    4343        #    <input type="hidden" name="_method" value="PUT" /> 
    4444        # Or using helpers: 
    45         #    h.form(h.url_for('extent_transaction', id=ID), method='put') 
    46         # url_for('extent_transaction', id=ID) 
     45        #    h.form(h.url_for('extent_t_method', id=ID), method='put') 
     46        # url_for('extent_t_method', id=ID) 
    4747        pass 
    4848     
     
    5252        #    <input type="hidden" name="_method" value="DELETE" /> 
    5353        # Or using helpers: 
    54         #    h.form(h.url_for('extent_transaction', id=ID), method='delete') 
    55         # url_for('extent_transaction', id=ID) 
     54        #    h.form(h.url_for('extent_t_method', id=ID), method='delete') 
     55        # url_for('extent_t_method', id=ID) 
    5656        pass 
    5757     
    5858    def show(self, db_id, extent_id, id, format='html'): 
    5959        """GET /id: Show a specific item.""" 
    60         # url_for('extent_transaction', id=ID) 
     60        # url_for('extent_t_method', id=ID) 
    6161        c.dbs = dbs = self.dbs 
    6262        c.db_id = db_id 
     
    6565        c.method = c.extent.t[id] 
    6666        c.method_id = id 
    67         return render_response('/extent_transactions/show.html') 
     67        return render_response('/extent_t_methods/show.html') 
    6868     
    6969    def edit(self, id, format='html'): 
    7070        """GET /id;edit: Form to edit an existing item.""" 
    71         # url_for('edit_extent_transaction', id=ID) 
     71        # url_for('edit_extent_t_method', id=ID) 
    7272        pass 
    7373     
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_queries/index.html

    r2944 r2954  
    2020        <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 
    2121            >${h.plural(c.extent)}</a></li> 
    22         <li class="here"><a href="${h.url_for('extent_queries', db_id=c.db_id, extent_id=c.extent.name)}" 
     22        <li class="here"><a href="${h.url_for('extent_q_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    2323            >Queries</a></li> 
    2424    </ul> 
     
    2929        % for name in c.extent.q: 
    3030            <li> 
    31                 <a href="${h.url_for('extent_query', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 
     31                <a href="${h.url_for('extent_q_method', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 
    3232                    >${h.label(c.extent.q[name])}</a> 
    3333            </li> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_queries/show.html

    r2950 r2954  
    2222        <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 
    2323            >${h.plural(c.extent)}</a></li> 
    24         <li><a href="${h.url_for('extent_queries', db_id=c.db_id, extent_id=c.extent.name)}" 
     24        <li><a href="${h.url_for('extent_q_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    2525            >Queries</a></li> 
    26         <li class="here"><a href="${h.url_for('extent_query', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 
     26        <li class="here"><a href="${h.url_for('extent_q_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 
    2727            >${h.label(c.method)}</a></li> 
    2828    </ul> 
     
    3030 
    3131<%def name="actions()"> 
    32     <form method="POST" action="${h.url_for('extent_call_query', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}"> 
     32    <form method="POST" action="${h.url_for('extent_call_q_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}"> 
    3333        <input type="submit" value="Call" /> 
    3434    </form> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_transactions/index.html

    r2944 r2954  
    2020        <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 
    2121            >${h.plural(c.extent)}</a></li> 
    22         <li class="here"><a href="${h.url_for('extent_transactions', db_id=c.db_id, extent_id=c.extent.name)}" 
     22        <li class="here"><a href="${h.url_for('extent_t_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    2323            >Transactions</a></li> 
    2424    </ul> 
     
    2929        % for name in c.extent.t: 
    3030            <li> 
    31                 <a href="${h.url_for('extent_transaction', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 
     31                <a href="${h.url_for('extent_t_method', db_id=c.db_id, extent_id=c.extent.name, id=name)}" 
    3232                    >${h.label(c.extent.t[name])}</a> 
    3333            </li> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extent_transactions/show.html

    r2950 r2954  
    2222        <li><a href="${h.url_for('extent', db_id=c.db_id, id=c.extent.name)}" 
    2323            >${h.plural(c.extent)}</a></li> 
    24         <li><a href="${h.url_for('extent_transactions', db_id=c.db_id, extent_id=c.extent.name)}" 
     24        <li><a href="${h.url_for('extent_t_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    2525            >Transactions</a></li> 
    26         <li class="here"><a href="${h.url_for('extent_transaction', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 
     26        <li class="here"><a href="${h.url_for('extent_t_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}" 
    2727            >${h.label(c.method)}</a></li> 
    2828    </ul> 
     
    3030 
    3131<%def name="actions()"> 
    32     <form method="POST" action="${h.url_for('extent_call_transaction', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}"> 
     32    <form method="POST" action="${h.url_for('extent_call_t_method', db_id=c.db_id, extent_id=c.extent.name, id=c.method_id)}"> 
    3333        <input type="submit" value="Call" /> 
    3434    </form> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/templates/extents/show.html

    r2944 r2954  
    4848    <ul> 
    4949        <li> 
    50                 <a href="${h.url_for('extent_queries', db_id=c.db_id, extent_id=c.extent.name)}" 
     50                <a href="${h.url_for('extent_q_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    5151                    >Queries</a> 
    5252        </li> 
    5353         
    5454        <li> 
    55             <a href="${h.url_for('extent_transactions', db_id=c.db_id, extent_id=c.extent.name)}" 
     55            <a href="${h.url_for('extent_t_methods', db_id=c.db_id, extent_id=c.extent.name)}" 
    5656                >Transactions</a> 
    5757        </li> 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extent_q_methods.py

    r2938 r2954  
    22 
    33 
    4 class TestExtentQueriesController(TestController): 
     4class TestExtentQMethodsController(TestController): 
    55     
    66    def test_index(self): 
    77        response = self.app.get( 
    8             url_for('extent_queries', db_id='db', extent_id='Foo')) 
     8            url_for('extent_q_methods', db_id='db', extent_id='Foo')) 
    99        assert 'By Example' in response 
    1010        assert 'Exact Matches' in response 
     
    1212    def test_get_exact(self): 
    1313        response = self.app.get( 
    14             url_for('extent_query', db_id='db', extent_id='Foo', 
     14            url_for('extent_q_method', db_id='db', extent_id='Foo', 
    1515            id='exact')) 
    1616        assert 'Exact Matches' in response 
     
    1818    def test_call_exact(self): 
    1919        response = self.app.post( 
    20             url_for('extent_call_query', db_id='db', extent_id='Foo', 
     20            url_for('extent_call_q_method', db_id='db', extent_id='Foo', 
    2121            id='exact')) 
    2222        assert response.status == 302 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extent_t_methods.py

    r2937 r2954  
    22 
    33 
    4 class TestExtentTransactionsController(TestController): 
     4class TestExtentTMethodsController(TestController): 
    55     
    66    def test_index(self): 
    77        response = self.app.get( 
    8             url_for('extent_transactions', db_id='db', extent_id='Foo')) 
     8            url_for('extent_t_methods', db_id='db', extent_id='Foo')) 
    99        assert 'Create' in response 
    1010 
    1111    def test_get_create(self): 
    1212        response = self.app.get( 
    13             url_for('extent_transaction', db_id='db', extent_id='Foo', 
     13            url_for('extent_t_method', db_id='db', extent_id='Foo', 
    1414            id='create')) 
    1515        assert 'Call' in response 
     
    1717    def test_call_create(self): 
    1818        response = self.app.post( 
    19             url_for('extent_call_transaction', db_id='db', extent_id='Foo', 
     19            url_for('extent_call_t_method', db_id='db', extent_id='Foo', 
    2020            id='create')) 
    2121        assert response.status == 302 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extents.py

    r2925 r2954  
    1616        assert 'Queries' in response 
    1717        assert url_for( 
    18             'extent_queries', db_id='db', extent_id='Foo') in response 
     18            'extent_q_methods', db_id='db', extent_id='Foo') in response 
    1919        assert 'Transactions' in response 
    2020        assert url_for( 
    21             'extent_transactions', db_id='db', extent_id='Foo') in response 
     21            'extent_t_methods', db_id='db', extent_id='Foo') in response 
    2222 
  • sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_transactions.py

    r2953 r2954  
    77        # First get the 'create' method. 
    88        response = self.app.post( 
    9             url_for('extent_call_transaction', db_id='db', extent_id='Foo', 
     9            url_for('extent_call_t_method', db_id='db', extent_id='Foo', 
    1010            id='create')) 
    1111        # Call it to get the transaction. 
     
    2020        # Get the transaction. 
    2121        response = self.app.post( 
    22             url_for('extent_call_transaction', db_id='db', extent_id='Foo', 
     22            url_for('extent_call_t_method', db_id='db', extent_id='Foo', 
    2323            id='create')) 
    2424        # Call it to get the transaction. 
     
    3131        # Get the transaction. 
    3232        response = self.app.post( 
    33             url_for('extent_call_transaction', db_id='db', extent_id='Foo', 
     33            url_for('extent_call_t_method', db_id='db', extent_id='Foo', 
    3434            id='create')) 
    3535        # Call it to get the transaction. 
     
    5353        # Get the transaction. 
    5454        response = self.app.post( 
    55             url_for('extent_call_transaction', db_id='db', extent_id='Foo', 
     55            url_for('extent_call_t_method', db_id='db', extent_id='Foo', 
    5656            id='create')) 
    5757        # Call it to get the transaction.