1. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
COLLAB
A DJANGO CONSTRUCTION KIT/TEMPLATE FOR APPS
1 of 18
3/1/14, 9:07 AM
2. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
I KNOW SOMETHING LIKE THAT...
2 of 18
3/1/14, 9:07 AM
3. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
THAT IS WHERE WE STARTED
3 of 18
3/1/14, 9:07 AM
4. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
AND THEN THERE WAS NOISE
4 of 18
3/1/14, 9:07 AM
5. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
AND MORE NOISE
5 of 18
3/1/14, 9:07 AM
6. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
CORE + APPS
6 of 18
3/1/14, 9:07 AM
7. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
CORE PROVIDES SERVICES
7 of 18
3/1/14, 9:07 AM
8. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
APPS FOLLOW (LIGHT) STANDARDS
8 of 18
3/1/14, 9:07 AM
9. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
CORE SERVICES
9 of 18
3/1/14, 9:07 AM
10. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
SEARCH
HAYSTACK
10 of 18
3/1/14, 9:07 AM
11. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
SEARCH_INDEXES.PY
from haystack import indexes
from core.models import Person
class PersonIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
user = indexes.CharField(model_attr='user')
display = indexes.CharField(model_attr='full_name', null=True)
description = indexes.CharField(model_attr='title', null=True)
index_name = indexes.CharField(indexed=False)
index_priority = indexes.IntegerField(indexed=False)
index_sort = indexes.IntegerField(indexed=False, null=True)
url = indexes.CharField(indexed=False, null=True)
PRIORITY = 1
def prepare_index_name(self, obj):
return "Staff Directory"
def prepare_index_priority(self, obj):
# Return 1 to display Staff Directory as first search result category
return self.PRIORITY
def prepare_index_sort(self, obj):
# sort results by last name
for index, item in enumerate(self.index_queryset().order_by("user__last_name")):
if item.id == obj.id:
return index
11 of 18
3/1/14, 9:07 AM
12. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
WIDGETS
DJANGO-WIDGETER
12 of 18
3/1/14, 9:07 AM
13. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
WIDGETS.PY
from widgeter.base import Widget
class HelloWorld(Widget):
block = 'home_side'
priority = '1'
template = 'hello_world/widget.html'
def get_context(self, context, options=None):
return { 'message': u'Hello World!' }
13 of 18
3/1/14, 9:07 AM
14. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
TAGGING
DJANGO-TAGGIT
14 of 18
3/1/14, 9:07 AM
15. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
NOTIFICATIONS
15 of 18
3/1/14, 9:07 AM
16. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
IMPROVED CACHING
DJANGO-CACHE-TOOLS
16 of 18
3/1/14, 9:07 AM
17. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
LIBRARIES
fabistrano
django-widgeter
django-cache-tools
17 of 18
3/1/14, 9:07 AM
18. Collab - A Django template
http://dlapiduz.github.io/collab-prezo/collab.html
GITHUB.COM/CFPB/COLLAB
@DLAPIDUZ
18 of 18
3/1/14, 9:07 AM