Limit attribute content depending on edit/view mode

Author Message

Eirik Alfstad Johansen

Wednesday 16 November 2005 4:13:36 am

Hi,

I've developed a datatype which allows the user to select from a drop down list of items (fetched from a separate db table) in edit mode, and then displays the selected item in view mode.

Furthermore, I've created a template displaying a list of objects which includes an attribute built upon this datatype, and the line view of the object includes an attribute_view of the attribute.

The list of objects is fairly long, and the problem is that the script times out because it has to fetch the list of items for each instance of the attribute, even though it only needs to return the selected item (in view mode).

So, is there any way to have the datatype return the list of items only if the attribute is in edit mode?

Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:40:11
Script start
Timing: Jan 31 2025 00:40:11
Module start 'layout'
Timing: Jan 31 2025 00:40:11
Module start 'content'
Timing: Jan 31 2025 00:40:11
Module end 'content'
Timing: Jan 31 2025 00:40:11
Script end

Main resources:

Total runtime0.0324 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.2813151.2266
Module start 'layout' 0.00540.0041 739.5078220.7188
Module start 'content' 0.00950.0212 960.2266997.7422
Module end 'content' 0.03060.0018 1,957.968829.9922
Script end 0.0324  1,987.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00268.1235140.0002
Check MTime0.00103.2150140.0001
Mysql Total
Database connection0.00102.971710.0010
Mysqli_queries0.00278.351330.0009
Looping result0.00000.030910.0000
Template Total0.00133.910.0013
Template load0.00092.919510.0009
Template processing0.00030.933510.0003
Override
Cache load0.00061.855910.0006
General
dbfile0.005918.037580.0007
String conversion0.00000.025040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs