Changeset 2064 in main for trunk/docs


Ignore:
Timestamp:
01/29/13 10:31:19 (6 years ago)
Author:
pcosquer
Message:

update application example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/en/devel/code/bicycle/views.py

    r808 r2064  
    1 import openPLM.plmapp.views as pviews 
     1from openPLM.plmapp.base_views import get_generic_data 
     2from openPLM.plmapp.utils import r2r 
    23 
    34 
    45def attributes(request, obj_ref, obj_revi): 
    5     """ Manage html page for attributes """ 
     6    """Custom attributes page """ 
    67    obj_type = "Bicycle" 
    7     obj, ctx = pviews.get_generic_data(request, obj_type, obj_ref, obj_revi) 
     8    obj, ctx = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    89    object_attributes = [] 
    910    for attr in obj.attributes: 
    1011        item = obj.get_verbose_name(attr) + ":" # <- this is our small modification 
    1112        object_attributes.append((item, getattr(obj, attr))) 
    12     ctx.update({'current_page':'attributes',  
     13    ctx.update({'current_page':'attributes', 
    1314                'object_attributes': object_attributes}) 
    14     return pviews.r2r('attributes.html', ctx, request) 
     15    return r2r('attributes.html', ctx, request) 
    1516 
Note: See TracChangeset for help on using the changeset viewer.