<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I took the liberty of attaching your reply to the end of this email.
<br>
<br>
>I think what you are completely missing is the power of marker
interfaces;<br>
<br>
Oh I think marker interfaces are brilliant, just what is needed for
larger projects, particularly for mult-developer projects. But they
add way too much complexity for the simple projects. Much like page
templates are brilliant if you are working with graphics designers,
but again too much complexity for the stand alone developer. <br>
<br>
So you are right that my overly long response was a bit confusing.
Thanks for the feedback, that is why I write. So here is what I did
not say. The Zopache computatinoal model is different from the Grok
computational model. No marker interfaces. Very little python.
Mostly a ZMI where you add <br>
objects and fill in some fields. And some python based templating
languages, right now mint. <br>
Later Jinja2 and Page Templates. I may do the tree of objects
representing a person, on the file system in python. Or maybe in
ZClasses.I will see. <br>
<br>
I have already put up about 10 model classes in grok. As well as
custom traverser and parental acquisition. So I do understand it.
Did you see how much code you had to write for all those Content
objects. And then adding them all to the application? In Zopache,
just use a GUI the ZMI, add a folder, add an HTML object, and type
up the content. Or use some other kind of template for the content,
like a mark up object. (Which I do not yet have, but guess will
need to add soon). Way way easier for simple projects. And so many
projects start off small and then grow. <br>
<br>
It is not just beginners. Even for the seasoned developer we have
way too much complexity overload. <br>
Whatever can be done to simplify our computational models of the
world, helps the seasoned developer as much as the novice
developer. Maybe more. <br>
<br>
Thanks for the dialogue. It hugely helps me understand what I am
doing. It is strange, here I am working by myself, but with so much
information up on the web for everyone to see. <br>
<br>
Chris<br>
<br>
. <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 8/20/14, 3:32 PM, Paul Sephton
wrote:<br>
</div>
<blockquote
cite="mid:CAOfQPM35nfA2NGrPu7HMRYNwoOQ-_MT_GxQZzWtjBHSBmgHDXQ@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi, Christopher,<br>
<br>
</div>
Thanks for the lengthy reply. Although I cannot yet say
that I fully understand what you are trying to say, I
think I understand enough for a response.<br>
<br>
</div>
When I said "...it makes no sense to me..." this was in
response to something I had written which in retrospect
looked senseless. It tends to happen to me more often
with age.<br>
<br>
</div>
In regard to your case for "Parental Acquisition", I think
it's really a lot simpler to implement than you imagine.<br>
<br>
</div>
You definitely don't want to modify the framework to get what
you want. I would typically implement each discrete model in
it's own Python source file.<br>
<br>
</div>
I think what you are completely missing is the power of marker
interfaces; naturally since large site layouts are not really
addressed properly in the tutorials.<br>
<div><br>
Let's see:<br>
<br>
/index<br>
/Content<br>
/ContactInfo/Content<br>
/SubmitResume/Content<br>
/PostJob/Content<br>
/Resumes/Content<br>
/Jobs/Content<br>
/Home<br>
<br>
<br>
import grok<br>
from zope.component import Interface<br>
<br>
class IContent(Interface):<br>
""" Marker Interface for Content """<br>
<br>
class ContentIndex(grok.View):<br>
""" Things that implement IContent will get this view """<br>
grok.context(IContent)<br>
<a moz-do-not-send="true" href="http://grok.name">grok.name</a>('index')<br>
<br>
def render(self):<br>
""" Renders content from the current context, which we
are assured<br>
implements the model for an IContent.<br>
"""<br>
<br>
class ISite(Interface):<br>
""" Marker Interface for main site index """<br>
<br>
class Index(grok.View):<br>
""" This view is available for all models which implement
ISite """<br>
grok.context(ISite)<br>
def render(self):<br>
""" Renders the site index with all the pretty common
bits. Also<br>
includes a <div
content="context/Content/@@index" /> to render<br>
the content for the appropriate section.<br>
<br>
We could also build our site here using viewlets
which is a great<br>
way to go.<br>
"""<br>
<br>
class ContentModel(grok.Model):<br>
""" Implements a content model """<br>
grok.implements(IContent)<br>
<br>
class ContactInfo(grok.Model):<br>
grok.implements(ISite)<br>
Content = ContentModel()<br>
grok.traversable('Content')<br>
<br>
class SubmitResume(grok.Model):<br>
grok.implements(ISite)<br>
Content = ContentModel()<br>
grok.traversable('Content')<br>
<br>
class PostJob(grok.Model):<br>
grok.implements(ISite)<br>
Content = ContentModel()<br>
grok.traversable('Content')<br>
<br>
class Resumes(grok.Model):<br>
grok.implements(ISite)<br>
Content = ContentModel()<br>
grok.traversable('Content')<br>
<br>
class Jobs(grok.Model):<br>
grok.implements(ISite)<br>
Content = ContentModel()<br>
grok.traversable('Content')<br>
<br>
<br>
class Home(grok.Model):<br>
grok.implements(ISite)<br>
<br>
class MainApp(grok.Container):<br>
grok.implements(ISite)<br>
<br>
def __init__(self):<br>
super(MainApp, self).__init__()<br>
self["Content"] = ContentModel()<br>
self["ContactInfo"] = ContactInfo()<br>
self["SubmitResume"] = SubmitResume()<br>
self["PostJob"] = PostJob()<br>
self["Resumes"] = Resumes()<br>
self["Jobs"] = Jobs()<br>
self["Home"] = Home()<br>
<br>
<div><br>
<br>
</div>
<div>Hope that helps,<br>
</div>
<div>Paul<br>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>