Legacy Pylons App Migration Questions ( 0.9.7 -> 0.1.0 / 1.x )

58 views
Skip to first unread message

Jonathan Vanasco

unread,
Oct 13, 2012, 4:40:41 PM10/13/12
to pylons-...@googlegroups.com
I'm migrating an old Pylons app to 1.0 ( eventually to Pyramid )

I've never migrated from .9.7 to 1.x before.  I've used 1.x, but this migration is confusing me a bit.

I've run into a few issues I'm hoping someone before me found/solved :

1. I had a lot of misc functions access the pylons.config variable .  i've migrated most to use the explicit pass-around, but I haven't been able to do that to all of them.  are there any good ways to access it when:

    a - in a request
    b - not in a request ( ie, class definition )

2. Pages don't render on 0.1.0  TypeError: No object (name: buffet) has been registered for this thread

 Module beaker.cache:65 in get         view
>>  return self._get_value(key, **kw).get_value()
Module beaker.container:263 in get_value         view
>>  v = self.createfunc()
Module myapp.controllers.splash:33 in _index         view
>>  return render('/splash.mako')
Module pylons.templating:662 in render         view
>>  return pylons.buffet.render(template_name=template, fragment=fragment,
Module paste.registry:137 in __getattr__         view
>>  return getattr(self._current_obj(), attr)
Module pylons.legacy:166 in _current_obj         view
>>  return StackedObjectProxy._current_obj(self, *args, **kwargs)
Module paste.registry:194 in _current_obj         view
>>  'thread' % self.____name__)
TypeError: No object (name: buffet) has been registered for this thread

3. before i tried to migrate things under 0.1.0, i ran it under 1.0 -- and i got a bunch of errors about "from pylons import c" not being valid anymore.  is this expected?


Jonathan Vanasco

unread,
Oct 13, 2012, 7:20:51 PM10/13/12
to pylons-discuss
well i solved the render issue...

in lib.base.py

bad:
from pylons.templating import render

good:
from pylons.templating import render_mako as render

which wasn't covered in the docs.

Mike Orr

unread,
Oct 14, 2012, 1:38:01 PM10/14/12
to pylons-...@googlegroups.com
from pylons import tmpl_context as c

The name 'c' was deprecated at some point, and removed in 1.0. It was
decided that self-explanatory names were better than sticking to the
Myghty one-letter names.

Glad you got your template issue solved. I thought that was documented
somewhere, but it's been so long since 1.0 came out that I've
forgotten where.

Also see the "Pylons application maintenance" message I'm about to write.

--
Mike Orr <slugg...@gmail.com>

Jonathan Vanasco

unread,
Oct 15, 2012, 11:40:17 AM10/15/12
to pylons-discuss
thanks mike!
Reply all
Reply to author
Forward
0 new messages