Commit 5ad2ec85 authored by Ivan Tyagov's avatar Ivan Tyagov

Changes on versioning catalog table

See merge request nexedi/erp5!1367
parents 4b516fe8 a25aed72
Pipeline #13932 failed with stage
......@@ -572,6 +572,14 @@ class TestDocument(TestDocumentMixin):
self.assertSameSet([],
sqlresult_to_document_list(document1.getImplicitPredecessorValueList()))
def test_catalog_search_by_size(self):
doc = self.portal.document_module.newContent(
portal_type='Spreadsheet',
file=makeFileUpload('import_data_list.ods'))
self.tic()
self.assertEqual(
[x.getObject() for x in self.portal.portal_catalog(size=doc.getSize())], [doc])
def testOOoDocument_get_size(self):
# test get_size on OOoDocument
doc = self.portal.document_module.newContent(portal_type='Spreadsheet')
......@@ -3032,4 +3040,4 @@ def test_suite():
return suite
# vim: syntax=python shiftwidth=2
# vim: syntax=python shiftwidth=2
\ No newline at end of file
REPLACE INTO
versioning
(`uid`, `version`, `language`, `revision`, `subject_set_uid`, `effective_date`,
(`uid`, `version`, `size`, `language`, `revision`, `subject_set_uid`, `effective_date`,
`expiration_date`, `creation_date_index`, `frequency_index`)
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="getVersion[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getSize[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getLanguage[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getRevision[loop_item]" type="string" optional>,
<dtml-sqlvar expr="subject_set_uid[loop_item]" type="int" optional>,
......
......@@ -14,22 +14,20 @@
</item>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\n
getLanguage\n
getVersion\n
getSize\n
getRevision\n
subject_set_uid\n
getEffectiveDate\n
getExpirationDate\n
getCreationDateIndex\n
getFrequencyIndex\n
</string> </value>
getFrequencyIndex</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
......@@ -37,11 +35,15 @@ getFrequencyIndex\n
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_hook</string> </key>
......@@ -87,7 +89,7 @@ getFrequencyIndex\n
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
<value> <string>z_catalog_versioning_list</string> </value>
</item>
<item>
<key> <string>type</string> </key>
......
CREATE TABLE `versioning` (
`uid` BIGINT UNSIGNED NOT NULL,
`version` varchar(10) default '',
`version` varchar(255) default '',
`size` BIGINT SIGNED,
`language` varchar(5) default '',
`revision` varchar(10) default '',
`subject_set_uid` INT UNSIGNED,
......
......@@ -12,10 +12,26 @@
<tuple/>
</value>
</item>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
......@@ -30,7 +46,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
<value> <string>z_create_versioning</string> </value>
</item>
</dictionary>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment