[Zope3-Users] Wierd import problem

2006-02-28 Thread Florian Lindner
Hello,
I've a wierd problem which is supposed to be plain simple but I can't see 
it...

Zope3 gives on startup:


  File /home/florian/Desktop/zope/lib/python/CS/user_management/views.py, 
line 2, in ?
from interfaces import IRegistrationForm
  File 
/home/florian/Desktop/zope/lib/python/CS/user_management/interfaces.py, 
line 5, in ?
from views import UserRegistrationField
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
/home/florian/Desktop/zope/etc/site.zcml, line 7.2-7.55
ZopeXMLConfigurationError: File 
/home/florian/Desktop/zope/etc/package-includes/cs-configure.zcml, line 
1.0-1.24
ZopeXMLConfigurationError: File 
/home/florian/Desktop/zope/lib/python/CS/configure.zcml, line 20.4-20.42
ZopeXMLConfigurationError: File 
/home/florian/Desktop/zope/lib/python/CS/user_management/configure.zcml, 
line 3.4-11.38
ImportError: cannot import name UserRegistrationField



my views.py has:


class UserRegistrationField(TextLine):
implements(ITextLine)

def _validate(self, value):
super(UserRegistrationField, self)._validate(value)
[...]


and my interfaces.py:

from views import UserRegistrationField

both are in the same directory. If I remove the the import everything goes 
well. If I cutpaste the code from views.py to interfaces it works too.

What am I doing wrong here?


Thanks,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Beginner's question: Components without persistence?

2006-02-28 Thread Reinhold Strobl
Lennart Regebro [EMAIL PROTECTED] writes:

 
 On 2/28/06, Reinhold Strobl [EMAIL PROTECTED] wrote:
  Hi,
 
  I would like to know, if components must always be persistent.
 
 Well, in general, only local components, or components who need to
 store data needs persistence.
 --
 Lennart Regebro, Nuxeo http://www.nuxeo.com/
 CPS Content Management http://www.cps-project.org/
 

Thanks, my general question remains:

where do I put application logic???



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Beginner's question: Components without persistence?

2006-02-28 Thread Brad Allen


At 2:46 PM +0100 2/28/06, Lennart Regebro wrote:

On 2/28/06, Reinhold Strobl [EMAIL PROTECTED] wrote:

 where do I put application logic???


Ööööh. In Python code? :-)

I have the feeling I don't understand the question.


I think I understand the question. Most of the tutorials show
how to build a content component, not how to build a website.

Other Python web frameworks let you map URLs to Python
class methods, but Zope 3 doesn't do that so how do you
get the output of your Python code to a web page if you
don't want to follow the usual instructions for building
a persistent content component?

I think my naive answer is that you have to register a URL name
in ZCML that points to a page template (ZPT), which can then
contain TAL expressions to access Python code. However, this
can get ugly...you probably should create a view for your
non-persistent object, and then insert the output of the view
into your ZPT...but how you instantiate the object without using
Python in your TAL, I don't know. I've been a bit of a slow
learner about Zope 3...
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: ZopeX3 Component Architecture in comparision to MVC - general question/example

2006-02-28 Thread Reinhold Strobl


Thanks for the reply. But how would you implement previously described task with
the calculator? 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] introductory app idea: music filesystem browser

2006-02-28 Thread Roman Susi
ksmith99 wrote:
 I would add ZPT, skins and increasingly formlib to the list of things to
 learn. +1 on demos vs. tutorials. A good working demo functions as both a
 tutorial and a testimonial. 
 
 I think right off the bat, the bookmarker app should be incrementally
 expanded. Evolving the app *is* the power of Zope3. 
 
 Other apps that start off easy but can grow increasinly complex fast.
  * blog
  * wiki

Wiki is already there (ZWiki ported to Zope3). Hard to call it demo, but
 worth looking into. Other candidates:
 * photo (media) album
 * bug tracker
 * shoping basket (pluggable)
 * simple library system
 * web calendar
 * guest book
 * calculator
 * chat
 * poll
 * FAQ management
 * forum


 
 I've been wanting to put together a Concept Map companion to the Bookmarker
 tutorial. If anyone is interested in helping out please give me a buzz, and
 I'll setup a collaborative concept map.

Regards,
Roman Suzi

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Multiple sites in a single zope instance?

2006-02-28 Thread Tom Dossis

Graham Stratton wrote:

What I want to be able to do is to simply create many 'sites' within a
single instance.  What matters is that each site can have its own
appearance and users (editors).

Now, I'm not sure that my sites actually need to be true Zope3 sites.
Maybe I just need to have a marker interface at the top level of each of
my sites, and that will be enough.


Probably best to Make a Site.  This will enable you to install utils 
into each site.
This will also enable you set up resources specific to each site.  This 
could be useful for your skinning requirements.




But what I don't seem to have any
way of doing is setting the appearance per site.  I haven't looked at
the users problem yet.


You can install separate PAU's (Pluggable Auth. Util.) into each site to 
have different user bases for each site.  Alternatively installing a PAU 
into a top level site enables you to share the user base across sites.




I could set up multiple skins, and then change the skin by using apache
rewrite rules.  But both parts of this are quite hard and complex, and
involve restarting both systems.  I'd like to be able to set simple
things about the appearance TTW.  At this point I fear I'm going very
wrong, but I'll continue anyway  ;-)


I'm guessing a little about how you want to set the appearance TTW...

Write a utility to manage certain site skin config. and properties. 
Your skin can consult this utility to obtain appearance 
parameters/objects.  Also the util. could make images/files (logo's, 
css) available as resources to your skin.


regards
-Tom

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


RE: [Zope3-Users] zodb objects backup

2006-02-28 Thread Shaun Cutts
  It would be very nice if there were a faq or other doc addressing
all of
  these scalability-related questions systematically for someone like
me
  who understands what a relational database is doing for them (in
return
  for squashing all their objects). It seems I'm not the only one with
  these concerns. :)
 
 Welcome to Open Source, we look forward to seeing your newly-written
faq
 as it becomes available online ;-)

Well, I've got enough info to write one by now... only, not having
reviewed or tested the code, I couldn't actually vouch for it.

But seriously, coming to Zope for an app server, I had no idea that ZODB
was as robust as it seems to be. I think, from a marketing standpoint
for the Zope corp (and other in the community deriving sustenance from
providing zope-related products and services), it would make a lot of
sense if they at least made the claim in a prominent place that ZODB was
a serious candidate to replace a RDBMS if you didn't absolutely need
SQL. Collecting the info together could be put on the todo list, but
motivating people to seek it out would be a good first step.

  In the meantime, I had an idea about my current implementation:
maybe
  instead of __getstate__ and __setstate__ I should put the external
data
  in _v_data (marking as volatile). Then I could trap for its
existence,
  and load if necessary; and also have an explicit refresh wired to
a
  button in the GUI.
 
 Yup, this is exactly what _v_ was designed for...
 
Great.

- Shaun


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] introductory app idea: music filesystem browser

2006-02-28 Thread baiju m
  Other apps that start off easy but can grow increasinly complex fast.
   * blog
   * wiki

 Wiki is already there (ZWiki ported to Zope3). Hard to call it demo, but
  worth looking into. Other candidates:
  * photo (media) album
  * bug tracker
  * shoping basket (pluggable)
  * simple library system
  * web calendar
  * guest book
  * calculator
  * chat
  * poll
  * FAQ management
  * forum

I have just started working on an example app for Zope 3 tutorial.
This is not yet finished, I am looking for feedback.

http://codespeak.net/svn/z3/zopeweb/trunk/content/documentation/z3tut/

I think we can discuss Zope documentation, demo apps and new zope.org
at zope-web list.

Few weeks back I have proposed a new tutorial here:

  http://mail.zope.org/pipermail/zope-web/2006-February/003702.html

Based on this, I am creating this tutorial app.

P.S: I am not yet created a production stage Zope 3 application.

Regards,
Baiju M
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: ZopeX3 Component Architecture in comparision to MVC - general question/example

2006-02-28 Thread Darryl Cousins
On Tue, 2006-02-28 at 17:52 +0100, Lennart Regebro wrote:
 On 2/28/06, Reinhold Strobl [EMAIL PROTECTED] wrote:
  Thanks for the reply. But how would you implement previously described task 
  with
  the calculator?
 
 I would implement it as a view on whatever object I want to view it
 on. Which may even be *, that is any object.

Hi Reinhold,

Here's a go at answering your problem. I gather you don't even need a
component as such - just a piece of code to perform a calculation. I
borrowed a technique from SchoolBell which may help. I think it may help
because it provides a way of performing any variety of python code
within a tal template without using python in the template. Any method
added to TFWSAPI can be accessed in tal with 'tfws:mymethod'. I've not
used XMLRPC calls with Zope so I'm not sure how it will translate. Good
luck.

Best regards,
Darryl

  !-- gives all sorts of lovely custom TAL expressions --
  zope:adapter
  for=*
  name=tfws
  provides=zope.app.traversing.interfaces.IPathAdapter
  factory=.tfwsapi.TFWSAPI
  /

class TFWSAPI(object):
TALES function namespace for TFWS specific actions.

Borrowed from SchoolBell.


implements(IPathAdapter, ITALESFunctionNamespace)

def __init__(self, context):
self.context = context

# as example
def authenticated(self):
Check whether context is an authenticated principal.

Sample usage in a page template:

div tal:define=user request/principal
span tal:condition=user/tfws:authenticated
  tal:replace=user/title
  User title
/span
span tal:condition=not:user/tfws:authenticated
  Anonymous
/span/div


if not IPrincipal.providedBy(self.context):
raise TypeError(tfws:authenticated can only be applied
 to a principal)
return not IUnauthenticatedPrincipal.providedBy(self.context)
authenticated = property(authenticated)

 
 --
 Lennart Regebro, Nuxeo http://www.nuxeo.com/
 CPS Content Management http://www.cps-project.org/
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users
-- 
Darryl Cousins
Tree Fern Web Services (NZ) Ltd
http://www.treefernwebservices.co.nz/

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users