Re: What I'd like to see gsoc achieve: plone distributions

Dylan Jay <djay-n0pU0XVUApFWk0Htik3J/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
> On 2 Apr 2015, at 5:25 pm, Asko Soukka <[email protected]> wrote:
> 
>> Dylan Jay <djay-n0pU0XVUApFWk0Htik3J/[email protected]> kirjoitti 2.4.2015 kello 12.02:
>> I haven't used a legacy portlet in 5 years. They should really die since nowhere else lets you put ZPT code inside the content space and where content editors can screw it up and break the page. In fact can't we drop it in plone5?
> 
> Well, someone could refactor it into optional add-on.
> 
> Context portlet configuration (with inheritance and blocking) is still something, which cannot be fully solved with Diazo. Even blocks / deco / mosaic is still lacking missing that.

Not sure what you mean. I thought you we were just talking about legacy portlets which include ZPT in them?
Yes we still need portlets and the ability to configure portlets in GS.
But we don't need portal_skins and ZMI scripts and ZPT. It can be all in the theme.

> 
>>> I did an experimental branch, where you can define restricted python view methods for fragment views:
>>> 
>>> https://github.com/collective/collective.themefragments/commit/75c194b26a5dd9a3827c2d43876042fb3cd860c2
>> 
>> Can you call python directly from diazo?
> 
> I hope not. Why would you want to?

Let's say I want to do

<replace content=".lastupdated" href="@@lastupdatedview" />

Why do I have to create a ZPT template to achieve that? Why not also allow python views to return values or html that can be used?
Alternatively as I suggested the ZPT could be automatically generated this works

def lastupdatedview(context, request):
	return {'lastupdated':context.lastupdated}

<replace content=".lastupdated" content-from="//lastupdated" href="@@lastupdatedview" />


> 
>> Is there any differences from what you've added to fragments and erics proposal?
> 
> - those were standalone files with methods, these are one method per file (like PythonScripts or ZClass methods) and bound to template (like a method in class based view)

I think if we could get it as close to a view as possible it would make things much less confusing for a user. Having one way to do things TTW and another on the FS is just painful all round.

class LastupdatedView(BrowserView):
	def __call__(self):
            return {'lastupdated':self.context.lastupdated}

unless we also want to introduce method only views into plone like pyramid has....

> 
> - Eric's script accept parameters, but in the examples those were only to get the context for the method; in fragment scripts have "self.context" (and parameters don't make much sense when view methods are called from a template)
> 
> - Eric planned to use zope.untrustedpython, where I still used the old RestrictedPython (maybe Eric could help me to fix that)
> 
> Cheers,
> Asko


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.