[Checkins] SVN: megrok.form/branches/ Adding branch to collective.namedblobfile compatibility

Dirceu Pereira Tiegs dirceutiegs at gmail.com
Wed Mar 19 17:27:34 EDT 2008


Log message for revision 84793:
  Adding branch to collective.namedblobfile compatibility

Changed:
  A   megrok.form/branches/collective.namedblobfile_support/
  U   megrok.form/branches/collective.namedblobfile_support/setup.py
  U   megrok.form/branches/collective.namedblobfile_support/src/megrok/form/TODO.txt
  U   megrok.form/branches/collective.namedblobfile_support/src/megrok/form/fields.py
  U   megrok.form/branches/collective.namedblobfile_support/src/megrok/form/tests/test_form.py
  D   megrok.form/branches/z3c.blobfile_support/

-=-
Copied: megrok.form/branches/collective.namedblobfile_support (from rev 84715, megrok.form/trunk)

Modified: megrok.form/branches/collective.namedblobfile_support/setup.py
===================================================================
--- megrok.form/trunk/setup.py	2008-03-16 18:59:39 UTC (rev 84715)
+++ megrok.form/branches/collective.namedblobfile_support/setup.py	2008-03-19 21:27:34 UTC (rev 84793)
@@ -2,7 +2,7 @@
 from os import sep
 from os.path import curdir
 
-version = '0.1'
+version = '0.2'
 
 long_description = open(sep.join((curdir, 'src','megrok','form','README.txt'))).read()
 
@@ -21,7 +21,7 @@
       keywords="grok form widgets fields constraints",
       author="Dirceu Pereira Tiegs",
       author_email="dirceutiegs at gmail.com",
-      url="http://svn.zope.org/Sandbox/dirceu/megrok.form",
+      url="http://svn.zope.org/megrok.form",
       license="ZPL",
       package_dir={'': 'src'},
       namespace_packages=['megrok'],
@@ -34,6 +34,7 @@
                         'z3c.widget',
                         'zc.datetimewidget',
                         'collective.namedfile',
+                        'collective.namedblobfile',
                         ],
       entry_points="""
       # Add entry points here

Modified: megrok.form/branches/collective.namedblobfile_support/src/megrok/form/TODO.txt
===================================================================
--- megrok.form/trunk/src/megrok/form/TODO.txt	2008-03-16 18:59:39 UTC (rev 84715)
+++ megrok.form/branches/collective.namedblobfile_support/src/megrok/form/TODO.txt	2008-03-19 21:27:34 UTC (rev 84793)
@@ -2,8 +2,6 @@
 megrok.form TODO
 ================
 
-- Release the egg
-
 - Add input tests for all widgets
 
 - Get rid of megrok.form.browser.tzinfo

Modified: megrok.form/branches/collective.namedblobfile_support/src/megrok/form/fields.py
===================================================================
--- megrok.form/trunk/src/megrok/form/fields.py	2008-03-16 18:59:39 UTC (rev 84715)
+++ megrok.form/branches/collective.namedblobfile_support/src/megrok/form/fields.py	2008-03-19 21:27:34 UTC (rev 84793)
@@ -1,6 +1,8 @@
 from zope import interface, schema
 from collective.namedfile.field import NamedImage as Image
 from collective.namedfile.field import NamedFile as File
+from collective.namedblobfile.field import NamedBlobImage as BlobImage
+from collective.namedblobfile.field import NamedBlobFile as BlobFile
 import constraints
 import interfaces
 

Modified: megrok.form/branches/collective.namedblobfile_support/src/megrok/form/tests/test_form.py
===================================================================
--- megrok.form/trunk/src/megrok/form/tests/test_form.py	2008-03-16 18:59:39 UTC (rev 84715)
+++ megrok.form/branches/collective.namedblobfile_support/src/megrok/form/tests/test_form.py	2008-03-19 21:27:34 UTC (rev 84793)
@@ -2,7 +2,7 @@
 from zope import component, interface, schema
 from zope.publisher.browser import TestRequest
 from zope.schema.interfaces import ConstraintNotSatisfied
-from megrok.form.fields import Email, Image, HTML, File
+from megrok.form.fields import Email, Image, HTML, File, BlobFile, BlobImage
 import unittest
 
 class MeGrokFormTest(grok.Application, grok.Container):
@@ -17,17 +17,21 @@
     description = HTML(title=u"Description")
     birthday = schema.Date(title=u"Birthday")
     resume = File(title=u"Resume")
+    video = BlobFile(title=u"Favorite Video")
+    wallpaper = BlobImage(title=u"Favorite Wallpaper")
 
 class Person(grok.Model):
     interface.implements(IPerson)
 
-    def __init__(self, name, email, picture, description, birthday, resume):
+    def __init__(self, name, email, picture, description, birthday, resume, video, wallpaper):
         self.name = name
         self.email = email
         self.picture = picture
         self.description = description
         self.birthday = birthday
         self.resume = resume
+        self.video = video
+        self.wallpaper = wallpaper
 
 class AddPerson(grok.AddForm):
     grok.context(MeGrokFormTest)
@@ -74,6 +78,14 @@
         # test rendered file widget
         s = """<div class="widget">\n\t<input type="hidden" value="" name="form.resume.used"\n        id="form.resume.used" />\n\t\n\t\n\t<div>\n\t\t<input type="file" maxlength="True" class="" size="30"\n         name="form.resume" id="form.resume" />\n\t\t\n\t</div>\n</div>"""
         assert(s in rendered_form)
+
+        # test rendered blobfile widget
+        s = """<div class="widget">\n\t<input type="hidden" value="" name="form.video.used"\n        id="form.video.used" />\n\t\n\t\n\t<div>\n\t\t<input type="file" maxlength="True" class="" size="30"\n         name="form.video" id="form.video" />\n\t\t\n\t</div>\n</div>"""
+        assert(s in rendered_form)
+
+        # test rendered blobimage widget
+        s = """<div class="widget">\n\t<input type="hidden" value="" name="form.wallpaper.used"\n        id="form.wallpaper.used" />\n\t\n\t\n\t<div>\n\t\t<input type="file" maxlength="True" class="" size="30"\n         name="form.wallpaper" id="form.wallpaper" />\n\t\t\n\t</div>\n</div>"""
+        assert(s in rendered_form)
         
     def test_email_default_constraint(self):
         """



More information about the Checkins mailing list