Re: Folderish + Behavior + NameChooser = oddness

Eric Bréhault <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAGMLr==MRyYqkF-7BY0PMGK_R495ATCYTq2-TEaJ4hhupXAHdw@mail.gmail.com>
I do not think we can change it, as you said, both solutions are bad, so it
implies we need to stick with the current mechanism (i.e. the Foo content
will be named foo-1 automatically).

Nevertheless I am not sure it is that bad, a good naming convention in your
schemas might be enough to avoid the problem (for instance by prefixing
your field names, or just by using '_' as separator, like  in
'project_manager', because the id for "Project manager" will be
'project-manager', etc.)

Eric

On Thu, Mar 19, 2015 at 11:27 AM, Jens W. Klein <jens-/[email protected]>
wrote:

> On 2015-03-19 11:22, Eric Bréhault wrote:
> >> Do we need to check for attributes?
> >
> > I guess it has been done originally for TAL expression (in your example:
> > what context/foo should return?)
>
> No idea. Both is wrong.
>
> I avoid TALES where possible: Not to debug, munges errors.
>
> But this is indeed a problem.
>
> Jens
>
> > Eric
> >
> > On Thu, Mar 19, 2015 at 10:43 AM, Jens W. Klein
> > <jens-/[email protected]
> > <mailto:jens-/[email protected]>> wrote:
> >
> >     Hi,
> >
> >     I just found an effect that needs at least documentation or further
> >     discussion how to deal with it:
> >
> >     Given you have a behavior defining a field `foo` and add this to a
> >     folder and fill in the field `foo`. Now (by default) an attribute
> `foo`
> >     is set on the folder.
> >
> >     Now someone adds content (i.e. document) to the folder and name its
> >     Title `Foo`. It tries to get the lowercased title as id (Default
> >     NameChooser).
> >
> >     This goes down to `OFS/ObjectManager.py(106)checkValidId()`. There is
> >     also a check for Attributes, finds a `foo` already, so it is not
> allowed
> >     and it falls back to `foo-1`.
> >
> >     Now, for an average editor this does not make any sense. Because this
> >     happend silently he looks for a document namend `foo` and there is
> no.
> >     So he files a ticket in the projects tracker and bugs the developer.
> >
> >     So happend at a customer of mine.
> >
> >     And I'am sure this will happen again in future somewhere in the
> world in
> >     a different project.
> >
> >     Questions:
> >
> >     - Do we need to check for attributes?
> >
> >     - Why do we not make a clear difference between dict and attribute
> >     access (so dict=contained, attributes=...well...attributes/data.
> >
> >     - Can/Shall/Must we change this or is documentation of this oddness
> >     enough?
> >
> >     Jens
> >     --
> >     Klein & Partner KG, member of BlueDynamics Alliance
> >
> >
> >
>  ------------------------------------------------------------------------------
> >     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/
> >     _______________________________________________
> >     Plone-developers mailing list
> >     Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> >     <mailto:Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> >     https://lists.sourceforge.net/lists/listinfo/plone-developers
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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/
> >
> >
> >
> > _______________________________________________
> > Plone-developers mailing list
> > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/plone-developers
> >
>
>
> --
> Klein & Partner KG, member of BlueDynamics Alliance
>
>
>
> ------------------------------------------------------------------------------
> 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/
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers
>

------------------------------------------------------------------------------
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/

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
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.