Skip to content

Instantly share code, notes, and snippets.

View fulv's full-sized avatar
🇮🇹

Fulvio Casali fulv

🇮🇹
  • Soliton Consulting
  • San Diego, CA, USA
View GitHub Profile
@fulv
fulv / gist:3114114
Created July 15, 2012 00:30
buildout error: known good Plone 3 buildout ignores fake-eggs
Installing 'mr.developer<1.10', 'buildout.dumppickedversions'.
We have the distribution that satisfies 'mr.developer==1.0'.
We have the distribution that satisfies 'buildout.dumppickedversions==0.4'.
Getting required 'elementtree==1.2.7-20070827-preview'
We have the distribution that satisfies 'elementtree==1.2.7-20070827-preview'.
mr.developer: Switching 'collective.formcriteria' with subversion.
mr.developer: Switching 'collective.gsqi' with subversion.
mr.developer: Skipped checkout of existing package 'collective.xdv'.
mr.developer: Switching 'travelpdx.plone' with subversion.
mr.developer: Skipped checkout of existing package 'travelpdx.simpleview'.
@fulv
fulv / setuplanguages.py
Created November 20, 2012 04:44
migrate I18NFolders
from Products.CMFCore.utils import getToolByName
from Acquisition import aq_parent, aq_inner
def setup(self):
result = []
setterupper = SetupFolders(self)
result.extend(setterupper.setup())
result.extend(setterupper.dfs(self))
result.extend(setterupper.linkGlobalTranslations())
return '\n'.join(result)
@fulv
fulv / testdb.xml
Created February 20, 2013 00:43
Sample Plomino db design to reproduce an issue with date fields in a datagrid (https://github.com/plomino/Plomino/issues/251). There are two forms: frmVendor and frmHistory. The main form is frmVendor, which has a single field: fldHistory. This field is a datagrid, and uses frmHistory as its associated form. The frmVendor onSave event creates a …
<plominodatabase id="testdb">
<design>
<dbsettings version="1.16">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">True</debugMode>
<StorageAttachments type="Products.Archetypes.Field.BooleanField">False</StorageAttachments>
@fulv
fulv / testdb.xml
Created November 1, 2013 02:23
Simple Plomino DB design to reproduce issue in Products.CMFPlomino 1.18.2: * Create a document with form1 * Then Open form2 The design consists of only two forms, with two fields each. Form2 was created as a copy of Form1, and then a formula was added in the beforeCreateDocument hook. The first field in both forms has a default value, the second…
<plominodatabase id="testdb">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@fulv
fulv / gist:7311639
Created November 5, 2013 00:06
This works similarly to https://gist.github.com/fulv/7260167. The only difference is that form1 and form2 have a flditems field, which is a datagrid, and uses formdatagrid as its associated form. Formdatagrid has two fields, a text fldname, and a number fldquantity. After creating a document with form1, containing a few datagrid rows, open form2.
<plominodatabase id="testdb2">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@fulv
fulv / buildout.cfg
Created May 21, 2014 21:01
buildout for mockup issue #374
############################################
#
# Buildout Configuration File for Plone
# -------------------------------------
#
# ALWAYS back up all Plone/Zope data and components
# before changing configuration.
#
# Running "bin/buildout" will update your installation,
# installing missing components as necessary.
> bin/test -s plonesocial.network
Test-module import failures:
Module: src.plonesocial.network.plonesocial.network.tests.test_graph
ImportError: No module named src.plonesocial.network.plonesocial.network.tests.test_graph
Module: src.plonesocial.network.plonesocial.network.tests.test_setup
# fulvio@Soliton13 (origin:plone5 * u=) ~/python/plone/clients/ploneintranet/ploneintranet.suite.plone5/src/plonesocial.network
> python bootstrap.py -v 2.2.1
While:
Initializing.
Error: The specified download cache:
'/Users/fulvio/python/plone/clients/ploneintranet/ploneintranet.suite.plone5/src/plonesocial.network/buildout-cache/downloads'
Doesn't exist.
@fulv
fulv / gist:03a43c4989c7e413cf94
Created November 5, 2014 15:31
configure.zcml
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:cmf="http://namespaces.zope.org/cmf"
i18n_domain="plonesocial.network">
<five:registerPackage package="." initialize=".initialize" />
<i18n:registerTranslations directory="locales" />
diff --git a/plonesocial/network/Extensions/Install.py b/plonesocial/network/Extensions/Install.py
new file mode 100644
index 0000000..af15c80
--- /dev/null
+++ b/plonesocial/network/Extensions/Install.py
@@ -0,0 +1,7 @@
+from Products.CMFCore.utils import getToolByName
+
+
+def uninstall(self, reinstall=False):