OSDN Git Service

fix player
authoryasushiito <yas@pen-chan.jp>
Thu, 20 Nov 2014 01:42:30 +0000 (10:42 +0900)
committeryasushiito <yas@pen-chan.jp>
Thu, 20 Nov 2014 01:42:30 +0000 (10:42 +0900)
30 files changed:
app/assets/javascripts/work/list_groups.js.coffee.erb
app/models/artist.rb
app/models/balloon.rb
app/models/comic.rb
app/models/comic_story.rb
app/models/ground_color.rb
app/models/ground_picture.rb
app/models/license.rb
app/models/panel.rb
app/models/panel_picture.rb
app/models/scroll.rb
app/models/scroll_panel.rb
app/models/sheet.rb
app/models/speech.rb
app/models/speech_balloon.rb
app/models/story.rb
app/models/story_sheet.rb
lib/local_manifest/list_group/list.rb
lib/local_manifest/list_group/list/base.rb
lib/local_manifest/list_group/list/filter.rb
lib/local_manifest/list_group/list/play.rb [new file with mode: 0644]
lib/locmare/list_group/list/base.rb
lib/locmare/list_group/list/filter.rb
lib/locmare/list_group/list/foreign_filter.rb
lib/locmare/list_group/list/play.rb
lib/locmare/list_group/list/through_filter.rb
lib/peta/content.rb
lib/peta/item.rb
lib/peta/leaf.rb
public/local_manifest.json

index 97b3a4b..1fbceaa 100644 (file)
         },\r
       },\r
       play: {\r
-        type: 'filter',\r
+        type: 'play',\r
         args: {\r
           filter_item_name: 'scroll',\r
-          item_wheres: ['index'],\r
-          list_wheres: ['play'],\r
+          wheres: ['index', 'play'],\r
         },\r
       },\r
     },\r
         },\r
       },\r
       play: {\r
-        type: 'public',\r
+        type: 'play',\r
+        args: {\r
+          filter_item_name: 'comic',\r
+          wheres: ['index', 'play'],\r
+        },\r
       },\r
     },\r
   },\r
         type: 'filter',\r
       },\r
       play: {\r
-        type: 'public',\r
+        type: 'play',\r
+        args: {\r
+          filter_item_name: 'story',\r
+          wheres: ['index', 'play'],\r
+        },\r
       },\r
     },\r
   },\r
       index: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
     },\r
       scrolls: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       scroll_panels: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       comics: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       comic_stories: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       stories: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       story_sheets: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       sheets: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       sheet_panels: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       panels: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       panel_pictures: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       speech_balloons: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       speeches: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       balloons: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       ground_pictures: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       ground_colors: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       original_pictures: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
       resource_pictures: {\r
         type: 'public',\r
         args: {\r
-          item_wheres: ['index'],\r
-          list_wheres: ['private'],\r
+          wheres: ['index', 'private'],\r
         },\r
       },\r
     },\r
index e37ceb8..3fc4bc9 100644 (file)
@@ -18,7 +18,7 @@ class Artist < Peta::Owner
     Artist.find( :first, :conditions => ['author_id = ?', author.id])
   end
   
-  def self.index_list_where
+  def self.index_list_where list
     'artists.provider_id is null'
   end
   
index 1a42b2e..73f538c 100644 (file)
@@ -37,7 +37,7 @@ self.system_picture_id = 1
     self.speech_balloon.speech_balloon_template.symbol_option
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index bedfdb9..ed15468 100644 (file)
@@ -32,7 +32,7 @@ class Comic < Peta::Binder
   def symbol_filename
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'comics.visible > 0'
   end
   
index 66c2acc..59b8096 100644 (file)
@@ -30,7 +30,7 @@ class ComicStory < Peta::Leaf
     self.disp_t_by_text + ':' + self.story.title
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'comics.visible > 0'
   end
   
index 27e1281..588196e 100644 (file)
@@ -86,7 +86,7 @@ class GroundColor < Peta::Element
     r
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index 9ac6bc5..b1f13f0 100644 (file)
@@ -80,7 +80,7 @@ class GroundPicture < Peta::Element
     @@repeat_texts[self.repeat]
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index ea2a716..009f51e 100644 (file)
@@ -21,7 +21,7 @@ class License < Peta::SystemResource
     self.license_group.caption + '/' + self.caption
   end
   
-  def self.index_list_where
+  def self.index_list_where list
     ''
   end
   
index ad20b01..f6fc3c7 100644 (file)
@@ -64,7 +64,7 @@ class Panel < Peta::Root
     }
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index 2aa3aff..1c9ce40 100644 (file)
@@ -96,7 +96,7 @@ class PanelPicture < Peta::Element
     self.picture.symbol_option
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index 17a5c5a..a206662 100644 (file)
@@ -29,7 +29,7 @@ class Scroll < Peta::Binder
     end
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'scrolls.visible > 0'
   end
   
index 44885a6..db7eaf5 100644 (file)
@@ -19,7 +19,7 @@ class ScrollPanel < Peta::Leaf
     self.author_id = operators.author.id
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'scrolls.visible > 0'
   end
   
index 9ff4b81..c63abe7 100644 (file)
@@ -38,7 +38,7 @@ class Sheet < Peta::Root
   def symbol_filename
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'sheets.visible > 0'
   end
   
index 1073cdf..6b6254e 100644 (file)
@@ -56,7 +56,7 @@ class Speech < Peta::Element
     @@text_align_texts[self.text_align]
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index 14b8f2d..00f38ad 100644 (file)
@@ -42,7 +42,7 @@ class SpeechBalloon < Peta::Element
     self.speech_balloon_template.symbol_option
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'panels.publish > 0'
   end
   
index 5c550e1..7c3354d 100644 (file)
@@ -31,7 +31,7 @@ class Story < Peta::Binder
     end
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'stories.visible > 0'
   end
   
index 7d32735..6acadc8 100644 (file)
@@ -13,7 +13,7 @@ class StorySheet < Peta::Leaf
     self.t = nil
   end
   
-  def self.public_list_where
+  def self.public_list_where list
     'stories.visible > 0'
   end
   
index 3ea261e..c9a18eb 100644 (file)
@@ -1,5 +1,5 @@
 ManifestBase.require_modules "local_manifest/list_group/list/", 
-  %w|base public system_resource filter through_filter foreign_filter|
+  %w|base public play system_resource filter through_filter foreign_filter|
 
 module LocalManifest
   module ListGroupModule
@@ -8,7 +8,7 @@ module LocalManifest
       
       def self.types
         {
-          'public' => PublicList, 'system_resource' => SystemResourceList,
+          'public' => PublicList, 'play' => PlayList, 'system_resource' => SystemResourceList,
           'filter' => FilterList, 'through_filter' => ThroughFilterList, 'foreign_filter' => ForeignFilterList
         }
       end
index 91f7511..a3fdb4c 100644 (file)
@@ -5,26 +5,19 @@ module LocalManifest
   module ListGroupModule
     module ListModule
       class Base < ManifestBase::TypeNameArgs
-        attr :list_wheres, :includes
+        attr :wheres, :includes
         
         def set_default
           super
-          @args['list_wheres'] ||= []
           @args['includes'] ||= {}
         end
         
         def init
           super
-          @item_wheres = @args['item_wheres']
-          @list_wheres = @args['list_wheres']
+          @wheres = @args['wheres'] || (self.model.content? ? ['index', 'public'] : ['index'])
           @includes = ManifestBase.load_type_args self, @args, 'includes', IncludeFactory
         end
         
-        def item_wheres
-          return @item_wheres if @item_wheres
-          @item_wheres = @args['item_wheres'] || (self.model.content? ? ['index', 'public'] : ['index'])
-        end
-        
         def model_manifest
           ::Manifest.manifest.models[self.item_name]
         end
index 8b219ec..7ad72fb 100644 (file)
@@ -14,6 +14,7 @@ module LocalManifest
           super
           @filter_item_name = @args['filter_item_name']
           @filter_key = @args['filter_key']
+          @wheres.push('filter') unless @wheres.include?('filter')
         end
         
       end
diff --git a/lib/local_manifest/list_group/list/play.rb b/lib/local_manifest/list_group/list/play.rb
new file mode 100644 (file)
index 0000000..714e322
--- /dev/null
@@ -0,0 +1,23 @@
+module LocalManifest
+  module ListGroupModule
+    module ListModule
+      class PlayList < Base
+        attr :filter_item_name, :filter_key
+        
+        def set_default
+          super
+          #@args['filter_item_name'] ||= @name.gsub(/^by_/, '')
+          @args['filter_key'] ||= @args['filter_item_name'] + '_id'
+        end
+        
+        def init
+          super
+          @filter_item_name = @args['filter_item_name']
+          @filter_key = @args['filter_key']
+        end
+        
+      end
+      
+    end
+  end
+end
index ab10b2f..0f57609 100644 (file)
@@ -13,8 +13,7 @@ module Locmare
         
         @list_group_manifest = LocalManifest.manifest.list_groups[@list_group_name]
         @list_manifest = @list_group_manifest.lists[@list_name]
-        @item_wheres = @list_manifest.item_wheres
-        @list_wheres = @list_manifest.list_wheres
+        @wheres = @list_manifest.wheres
         @includes = @list_manifest.includes
         
         @controller_name = @list_group_name
@@ -76,18 +75,15 @@ module Locmare
         self.order + ' ' + self.direction
       end
       
-      def where_condition
-        @item_wheres.map {|key| @model.__send__(key + '_list_where')}.compact.join(' and ')
-      end
-      
       def include_hash
         @includes.includes
       end
       
       def arel
-        r = @model.where(self.where_condition)
-        @list_wheres.each do |key|
-          r = r.where(@model.__send__(key + '_list_where', self))
+        r = @model
+        @wheres.each do |key|
+          n = key + '_list_where'
+          r = r.where(@model.respond_to?(n) ? @model.__send__(n, self) : self.__send__(n))
         end
         r.includes(
           self.include_hash
@@ -123,6 +119,21 @@ module Locmare
         end
       end
       
+      def private_list_where
+        owner_model = if @model.element?
+          @model.root_model
+        else
+          @model
+        end
+        case owner_model.owner_type
+        when :author
+          operator = @operators.author
+        when :artist
+          operator = @operators.artist
+        end
+        [owner_model.table_name + '.' + owner_model.owner_type.to_s + '_id = ?', operator.id]
+      end
+      
     end
     
   end
index 66084d3..846d60f 100644 (file)
@@ -11,10 +11,8 @@ module Locmare
         super
       end
       
-      def where_condition
-        w = super
-        w += ' and ' unless w.blank?
-        [w + @table_name + '.' + @filter_key + ' = ?', self.filter_id] 
+      def filter_list_where
+        [@table_name + '.' + @filter_key + ' = ?', self.filter_id] 
       end
       
       def include_hash
index 7eee78c..4a6ba61 100644 (file)
@@ -7,10 +7,8 @@ module Locmare
         @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
       end
       
-      def where_condition
-        w = super
-        w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
+      def filter_list_where
+        [@filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
       def include_hash
index 97d0028..7793815 100644 (file)
@@ -1,61 +1,33 @@
 module Locmare
   module ListGroupModule
-    class PlayList < FilterList
+    class PlayList < Base
+      attr :filter_key, :filter_item_name
       
-      def offset cnt, prm = nil
-        offset = prm.to_i
-        offset = cnt - 1 if offset >= cnt
-        offset = cnt - offset.abs if offset < 0
-        offset = 0 if offset < 0
-        offset
+      def init
+        @binder_action = @action_manifest.original
+        @binder_controller = @binder_action.controller
+        @binder_model = Manifest.manifest.models[@binder_action.item_name]
+        @binder_model_class = @binder_model.classify
+        @binder_item = @binder_model_class.show(self.filter_id, @operators)
+        
+        @wheres.delete('index') if @binder_item.own?(@operators)
+        @binder_list_group_manifest = LocalManifest.manifest.list_groups[@binder_controller.name]
+        @binder_list_manifest = @binder_list_group_manifest.lists[@binder_action.name]
+        @filter_key = @binder_list_manifest.filter_key
+        @filter_item_name = @binder_list_manifest.filter_item_name
+        @filter_model = ::Manifest.manifest.models[@filter_item_name].classify
+        @filter_table_name = @filter_model.table_name
+        super
       end
       
-      def limit prm
-        prm ||= self.default_page_size
-        count = prm.to_i
-        count = self.max_page_size if count > self.max_page_size
-        count = self.default_page_size if count < 1
-        count
+      def play_list_where
+        [@table_name + '.' + @filter_key + ' = ?', self.filter_id] 
       end
       
-      def where_condition filter_item_id, my_play = false
-        base_where = if my_play
-          ''
-        else
-          w = self.base_where_condition
-          w += ' and ' unless w.blank?
-          w
-        end
-        [base_where + @table_name + '.' + @filter_key + ' = ?', filter_item_id] 
-      end
-      
-      def items operators, options, offset, limit
-        filter_item_id = options[:id]
-        my_play = options[:my_play]
-        @model.where(self.where_condition(filter_item_id, my_play)).includes(self.include_hash).order(self.order).offset(offset).limit(limit)
-      end
-      
-      def count operators, options
-        filter_item_id = options[:id]
-        my_play = options[:my_play]
-        @model.where(self.where_condition(filter_item_id, my_play)).includes(self.include_hash).count
-      end
-      
-      def open operators, options
-        count = self.count operators, options
-        if options[:offset]
-          offset = self.offset count, options[:offset]
-          page_size = self.limit options[:count]
-          pg = nil
-        else
-          page = self.page_number(options[:page]) 
-          page_size = self.page_size options[:page_size]
-          offset = (page -1) * page_size
-          pg = self.paginate count, page, page_size
-        end
-        items = self.items operators, options, offset, page_size
-        self.boost items
-        ListResult.new self, items, count, pg, operators, options
+      def include_hash
+        w = super
+        w.merge!({@filter_item_name => {} }) unless w[@filter_item_name]
+        w
       end
       
     end
index 930c236..df10b63 100644 (file)
@@ -12,10 +12,8 @@ module Locmare
         {@through => {@filter_item_name => {}} }
       end
       
-      def where_condition
-        w = super
-        w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
+      def filter_list_where
+        [@filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
     end
index 083ac39..11050f4 100644 (file)
@@ -34,25 +34,10 @@ module Peta
       operators.__send__ self.owner_type
     end
     
-    def self.public_list_where
+    def self.public_list_where list
       nil
     end
     
-    def self.private_list_where list
-      owner_model = if self.element?
-        self.root_model
-      else
-        self
-      end
-      case owner_model.owner_type
-      when :author
-        operator = list.operators.author
-      when :artist
-        operator = list.operators.artist
-      end
-      [owner_model.table_name + '.' + owner_model.owner_type.to_s + '_id = ?', operator.id]
-    end
-    
     def self.edit content_id, operators
       content = self.find content_id, self.show_opt
       raise ActiveRecord::Forbidden unless content.own?(operators)
index 7bb9cb6..b6f2ca6 100644 (file)
@@ -114,7 +114,7 @@ module Peta
       self.my_peta.extend_column? column_name
     end
     
-    def self.index_list_where
+    def self.index_list_where list
       nil
     end
     
index d6e86b8..6d987c6 100644 (file)
@@ -65,10 +65,6 @@ module Peta
       self.table_name + '.t'
     end
     
-    def self.play_list_where list
-        [list.table_name + '.' + list.filter_key + ' = ?', list.filter_id] 
-    end
-    
     def self.new_t binder_id
       r = self.max_t(binder_id)
       r.blank? ? 0 : r.to_i + 1
index cd2c50d..b8ffbf8 100644 (file)
           }\r
         },\r
         "play": {\r
-          "type": "filter",\r
+          "type": "play",\r
           "args": {\r
             "filter_item_name": "scroll",\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "play"\r
             ]\r
           }\r
         "index": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "scrolls": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "scroll_panels": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "comics": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "comic_stories": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "stories": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "story_sheets": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "sheets": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "sheet_panels": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "panels": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "panel_pictures": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "speech_balloons": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "speeches": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "balloons": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "ground_pictures": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "ground_colors": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "original_pictures": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r
         "resource_pictures": {\r
           "type": "public",\r
           "args": {\r
-            "item_wheres": [\r
-              "index"\r
-            ],\r
-            "list_wheres": [\r
+            "wheres": [\r
+              "index",\r
               "private"\r
             ]\r
           }\r