Forums / General / Excluding nodes from a list fetch?

Excluding nodes from a list fetch?

Author Message

Josh Bair

Monday 04 May 2009 7:55:20 pm

We have 2 list fetches and want to exclude nodes from the first fetch in the second fetch. The parent_node_ids are the same as well as the class_attribute_filter. Is there anyway to do this without an extended attribute filter or unnecessarily fetching the same node twice?

Ideally we would pass an array of node ids to the second fetch and these would be excluded.

Łukasz Serwatka

Monday 04 May 2009 11:30:10 pm

This is not possible I'm afraid. You have to use extended attribute filter if you want to filter on specific node ids. I don't know details behind your implementation logic, but it might be also possible to use offset and max params for foreach template function if you want to skip some first nodes in second loop. Then only one fetch could be used.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Josh Bair

Tuesday 05 May 2009 8:07:07 am

Hey Łukasz,

I was able to use the offset method in a couple tpl locations but we also have an eZ Flow zone with 2 dynamic blocks that could benefit from this. Both blocks use eZFlowLatestObjects -- same class and parent; just a different number of active results.

Bård Farstad

Tuesday 05 May 2009 8:26:22 am

What about writing a custom template function optimized for your fetch? That also enables you to tune the query for your situation and optimize for memory usage and performance.

-bård

Documentation: http://ez.no/doc

Frédéric DAVID

Tuesday 05 May 2009 8:37:59 am

for exclude nodes from list fetch, you can use path in your attribute_filter.

attribute_filter, array( array( 'path', 'not_in', array( path_string, path_string) )

I don't know for the performance of this method.

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

eZ debug

Timing: Jan 29 2025 13:44:07
Script start
Timing: Jan 29 2025 13:44:07
Module start 'content'
Timing: Jan 29 2025 13:44:07
Module end 'content'
Timing: Jan 29 2025 13:44:08
Script end

Main resources:

Total runtime0.2180 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.0625180.8359
Module start 'content' 0.00580.0057 769.898497.8828
Module end 'content' 0.01150.2064 867.7813526.0469
Script end 0.2179  1,393.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.4777200.0002
Check MTime0.00120.5639200.0001
Mysql Total
Database connection0.00060.286610.0006
Mysqli_queries0.166976.53511410.0012
Looping result0.00170.78351390.0000
Template Total0.206194.510.2061
Template load0.00090.400010.0009
Template processing0.205294.131410.2052
Override
Cache load0.00060.286610.0006
Sytem overhead
Fetch class attribute can translate value0.00060.281610.0006
XML
Image XML parsing0.00020.096310.0002
General
dbfile0.00683.1173200.0003
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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