Greetings,

I'm trying to use the sample code on this page:
http://turbogears.org/2.0/docs/main/RestControllers.html

At the bottom, it tells you how to check out and run the sample code:

   svn co http://pythontutorials.googlecode.com/svn/tutorials/moviedemo/trunk/
moviedemo
   cd moviedemo
   python setup.py
   paster setup-app development.ini
   paster serve development.ini

First of all, "python setup.py" isn't right...it says I need to supply
a command.  I believe it should be "python setup.py develop".  Right?

Second, "paster setup-app development.ini" fails with the error (full
version at end of this message):

   ...
   class: <class 'moviedemo.model.Movie'>
   item: None
   Traceback (most recent call last):
     File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line
307, in from_list
       self.add_klasses(klass, items)
     File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line
225, in add_klasses
       obj = self.add_klass_with_values(klass, item)
     File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line
206, in add_klass_with_values
       resolved_values = self._check_types(klass, resolved_values)
     File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line
170, in _check_types
       obj[key] = func(value)
     File "build/bdist.linux-x86_64/egg/bootalchemy/converters.py",
line 43, in timestamp
       match = timestamp_regexp.match(value)
   TypeError: expected string or buffer
   ...

Huh?  I'm lost now.

Can anyone tell me why this is broken?  Did it work with earlier
versions of Python?  Has it broken due to some change to a dependent
package?

I'm running the latest, fully updated Fedora x64.  All of what I'm
working with comes from the standard RPMs for this distro, which means
I'm using Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) (RPM version:
2.7-8.fc14.1).

I followed the standard TG2 installation instructions, so I have a
tg2env VirtualEnv that contains a whole bunch of stuff in its local
site-packages, including TurboGears2-2.1-py2.7.egg

Any help would be greatly appreciated.

Blat




Here's the full text of the error I'm getting:

(tg2env)[steve@localhost moviedemo]$ paster setup-app development.ini
Running setup_config() from moviedemo.websetup
Creating tables
Adding Bootstrap Data...
error occured while loading yaml data with output:
[{'Group': [{'&managers': {'description': 'This permission give an
administrative right to the bearer',
                           'display_name': 'Managers Group',
                           'group_name': 'managers'}}],
  'User': [{'&manager': {'display_name': 'Example manager',
                         'email_address': '[email protected]',
                         'groups': ['*managers'],
                         'password': 'managepass',
                         'user_name': 'manager'}},
           {'&editor': {'display_name': 'Example editor',
                        'email_address': '[email protected]',
                        'password': 'editorpass',
                        'user_name': 'editor'}}],
  'flush': None},
 {'Director': [{'&robert': {'name': 'Robert Zemeckis'}},
               {'&david': {'name': 'David Fincher'}},
               {'&andy': {'name': 'Andy Wachowski'}},
               {'&larry': {'name': 'Larry Wachowski'}},
               {'&joel': {'name': 'Joel Coen'}}],
  'Genre': [{'&action': {'description': 'car chases, sex and
violence',
                         'name': 'action'}},
            {'&animation': {'description': 'cartoons and computer
rendered flicks',
                            'name': 'animation'}},
            {'&comedy': {'description': 'funny stuff', 'name':
'comedy'}},
            {'&documentary': {'description': 'purely information',
                              'name': 'documentary'}},
            {'&drama': {'description': 'makes your girlfriend cry',
                        'name': 'drama'}},
            {'&sci_fi': {'description': 'read: furturism',
                         'name': 'sci-fi'}}],
  'Movie': [{'description': 'In 1985, Doc Brown invents time travel;
in 1955, Marty McFly accidentally prevents his parents from meeting,
putting his own existence at stake',
             'directors': ['*robert'],
             'genre': '*sci_fi',
             'release_date': '1985-4-3',
             'title': 'Back to the Future'},
            {'description': 'An office employee and a soap salesman
build a global organization to help vent male aggression.',
             'directors': ['*david'],
             'genre': '*action',
             'release_date': datetime.date(1999, 10, 14),
             'title': 'Fight Club'},
            {'description': 'A computer hacker learns from mysterious
rebels about the true nature of his reality and his role in the war
against the controllers of it.',
             'directors': ['*larry', '*andy'],
             'genre': '*sci_fi',
             'release_date': '1999-3-31',
             'title': 'The Matrix'},
            {'description': '"Dude" Lebowski, mistaken for a
millionaire Lebowski, seeks restitution for his ruined rug and enlists
his bowling buddies to help get it.',
             'directors': ['*joel'],
             'genre': '*comedy',
             'release_date': '1998-3-6',
             'title': 'The Big Lebowski'}],
  'flush': None}]
references:
{'action': <moviedemo.model.Genre object at 0x21d5890>,
 'andy': <moviedemo.model.Director object at 0x21df0d0>,
 'animation': <moviedemo.model.Genre object at 0x21d5750>,
 'comedy': <moviedemo.model.Genre object at 0x21d5590>,
 'david': <moviedemo.model.Director object at 0x21df050>,
 'documentary': <moviedemo.model.Genre object at 0x21d5b50>,
 'drama': <moviedemo.model.Genre object at 0x21d57d0>,
 'editor': <User: email="[email protected]", display name="Example
editor">,
 'joel': <moviedemo.model.Director object at 0x21df1d0>,
 'larry': <moviedemo.model.Director object at 0x21df150>,
 'manager': <User: email="[email protected]", display
name="Example manager">,
 'managers': <Group: name=managers>,
 'robert': <moviedemo.model.Director object at 0x21d5910>,
 'sci_fi': <moviedemo.model.Genre object at 0x21d5950>}
class: <class 'moviedemo.model.Movie'>
item: None
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 307,
in from_list
    self.add_klasses(klass, items)
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 225,
in add_klasses
    obj = self.add_klass_with_values(klass, item)
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 206,
in add_klass_with_values
    resolved_values = self._check_types(klass, resolved_values)
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 170,
in _check_types
    obj[key] = func(value)
  File "build/bdist.linux-x86_64/egg/bootalchemy/converters.py", line
43, in timestamp
    match = timestamp_regexp.match(value)
TypeError: expected string or buffer

Traceback (most recent call last):
  File "/home/steve/Development/pearson/tg2env/bin/paster", line 8, in
<module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')
()
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line
84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line
123, in invoke
    exit_code = runner.run(args)
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/appinstall.py", line
68, in run
    return super(AbstractInstallCommand, self).run(new_args)
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/command.py", line
218, in run
    result = self.command()
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/appinstall.py", line
456, in command
    self, config_file, section,
self.sysconfig_install_vars(installer))
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/appinstall.py", line
598, in setup_config
    mod.setup_app, command, filename, section, vars)
  File "/home/steve/Development/pearson/tg2env/lib/python2.7/site-
packages/PasteScript-1.7.3-py2.7.egg/paste/script/appinstall.py", line
612, in _call_setup_app
    func(command, conf, vars)
  File "/home/steve/Development/pearson/tg2env/moviedemo/moviedemo/
websetup/__init__.py", line 19, in setup_app
    bootstrap(command, conf, vars)
  File "/home/steve/Development/pearson/tg2env/moviedemo/moviedemo/
websetup/bootstrap.py", line 63, in bootstrap
    loader.loads(model.DBSession, data)
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 360,
in loads
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 307,
in from_list
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 225,
in add_klasses
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 206,
in add_klass_with_values
  File "build/bdist.linux-x86_64/egg/bootalchemy/loader.py", line 170,
in _check_types
  File "build/bdist.linux-x86_64/egg/bootalchemy/converters.py", line
43, in timestamp
TypeError: expected string or buffer


-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to