Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get up-to-date with catalog changes in SD. Add parent mobile.

  • Loading branch information...
commit 497341c0912f8ad1fc5c96f4ecb9f8a1a647acca 1 parent a88e78b
@pauleveritt authored
View
1  fastbreak/__init__.py
@@ -14,7 +14,6 @@ def main(global_config, **settings):
config = Configurator(settings=settings,
root_factory=Site.root_factory)
config.include('substanced')
- config.include('.catalog')
config.set_authentication_policy(authn_policy)
config.set_authorization_policy(authz_policy)
config.scan()
View
19 fastbreak/catalog.py
@@ -1,19 +0,0 @@
-from substanced.catalog.indexes import (
- FieldIndex,
- TextIndex,
- KeywordIndex,
- )
-
-from substanced.catalog.discriminators import (
- get_textrepr,
- get_title,
- get_interfaces,
- )
-
-def includeme(config):
- config.add_catalog_index('name', FieldIndex('__name__'))
- config.add_catalog_index('title', FieldIndex(get_title))
- config.add_catalog_index('interfaces', KeywordIndex(get_interfaces))
- config.add_catalog_index('texts', TextIndex(get_textrepr))
- config.add_catalog_index('la_id', FieldIndex('la_id'))
-
View
28 fastbreak/site.py
@@ -1,16 +1,34 @@
-# Custom Substance D Site, so I can apply an ACL
+from pyramid.security import Allow
+from substanced.catalog import Catalog
+from substanced.catalog.indexes import (
+ FieldIndex,
+ TextIndex,
+ KeywordIndex,
+ )
+from substanced.catalog.discriminators import (
+ get_textrepr,
+ get_title,
+ get_interfaces,
+ )
from substanced.site import Site as _Site
-from pyramid.security import Allow
class Site(_Site):
- def __init__(self, initial_username, initial_email, initial_password):
- _Site.__init__(self, initial_username, initial_email,
- initial_password)
+ def __init__(self, *arg, **kw):
+ _Site.__init__(self, *arg, **kw)
+ # The retail view is also protected
self.__acl__.append(
(Allow, 'admininstrators', 'view')
)
self.title = 'New World Sports Dashboard'
+ # Setup catalog
+ catalog = Catalog()
+ catalog['name'] = FieldIndex('__name__')
+ catalog['title'] = FieldIndex(get_title)
+ catalog['interfaces'] = KeywordIndex(get_interfaces)
+ catalog['texts'] = TextIndex(get_textrepr)
+ catalog['la_id'] = FieldIndex('la_id')
+ self.add_service('catalog', catalog)
View
1  fastbreak/team/retail.py
@@ -81,7 +81,6 @@ def tournaments_view(self):
for player in self.context.players():
td = player.tourney_data
- print player.last_name, td.keys()
return dict(
heading=self.context.title + ' Tournaments',
View
4 fastbreak/team/templates/team_contacts.pt
@@ -10,6 +10,7 @@
<th>Primary Email</th>
<th>Parent</th>
<th>Parent Email</th>
+ <th>Parent Mobile</th>
</tr>
</thead>
<tbody>
@@ -34,6 +35,9 @@
${pg.primary_email()}
</a>
</td>
+ <td>
+ ${pg.mobile_phone}
+ </td>
</tal:block>
</tr>
</tbody>
Please sign in to comment.
Something went wrong with that request. Please try again.