[Zope3-checkins] CVS: Products3/NewsSite - interfaces.py:1.1 register.py:1.1 __init__.py:1.2
   
    Tres Seaver
     
    tseaver@zope.com
       
    Tue, 25 Mar 2003 11:28:31 -0500
    
    
  
Update of /cvs-repository/Products3/NewsSite
In directory cvs.zope.org:/tmp/cvs-serv7546
Modified Files:
	__init__.py 
Added Files:
	interfaces.py register.py 
Log Message:
  - Add interfaces and view code for a new add view, MemberAddView, which
    collects "member" data along with "user" data;  it will store the
    "member" data as an annotaion on the user, via an adapter to
    IMember.
=== Added File Products3/NewsSite/interfaces.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interface definitions for the registration demo.
$Id: interfaces.py,v 1.1 2003/03/25 16:28:00 tseaver Exp $
"""
from zope.interface import Interface
from zope.schema import TextLine, Password
class IMember(Interface):
    """Provide information about site members.
    ... to be written
    """
    realname = TextLine(title=u'Real name',
                        required=True)
    email = TextLine(title=u'E-Mail',
                     required=True)
    login = TextLine(title=u'Login',
                     required=True)
    password = Password(title=u'Password',
                required=True)
                        
    
    
=== Added File Products3/NewsSite/register.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Actual code for member registration.
$Id: register.py,v 1.1 2003/03/25 16:28:00 tseaver Exp $
"""
from zope.component import createObject
from zope.component import getAdapter
from interfaces import IMember
class MemberAddView:
    def create(self, login, password):
        
        id = login
        title = ''
        description = ''
        user = createObject(self.context, 'User', id, title, description,
                            login, password)
        user.setRoles(['Member'])
        return user
    def nextURL(self):
        return "welcome.html"       
=== Products3/NewsSite/__init__.py 1.1 => 1.2 ===
--- Products3/NewsSite/__init__.py:1.1	Tue Mar 25 07:48:54 2003
+++ Products3/NewsSite/__init__.py	Tue Mar 25 11:28:00 2003
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""NewsSite product.
+
+A sample content management application, which packages the content objects,
+skins, and application components for building a simple community-contributed
+news site.
+
+$Id$
+"""