Changeset 324 in main


Ignore:
Timestamp:
09/22/11 13:16:31 (8 years ago)
Author:
pcosquer
Message:

use values_list()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/views/main.py

    r323 r324  
    223223    obj, ctx, request_dict = get_generic_data(request, obj_type, obj_ref, obj_revi) 
    224224    if isinstance(obj, UserController): 
    225         histos = models.UserHistory.objects 
     225        history = models.UserHistory.objects 
    226226    else:  
    227         histos = models.History.objects 
    228     histos = histos.filter(plmobject=obj.object).order_by('date') 
    229     object_history_list = [] 
    230     for histo in histos: 
    231         object_history_list.append((histo.date, histo.action, histo.details)) 
     227        history = models.History.objects 
     228    history = history.filter(plmobject=obj.object).order_by('date') 
     229    history = history.values_list('date', 'action', 'details') 
    232230    ctx.update({'current_page' : 'history',  
    233                 'object_history' : object_history_list}) 
     231                'object_history' : history}) 
    234232    request.session.update(request_dict) 
    235233    return r2r('DisplayObjectHistory.htm', ctx, request) 
Note: See TracChangeset for help on using the changeset viewer.