SlideShare a Scribd company logo
1 of 18
Download to read offline
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
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
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
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
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

AND MORE NOISE

5 of 18

3/1/14, 9:07 AM
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

CORE + APPS

6 of 18

3/1/14, 9:07 AM
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

CORE PROVIDES SERVICES

7 of 18

3/1/14, 9:07 AM
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
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

CORE SERVICES

9 of 18

3/1/14, 9:07 AM
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

SEARCH
HAYSTACK

10 of 18

3/1/14, 9:07 AM
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
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

WIDGETS
DJANGO-WIDGETER

12 of 18

3/1/14, 9:07 AM
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
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

TAGGING
DJANGO-TAGGIT

14 of 18

3/1/14, 9:07 AM
Collab - A Django template

http://dlapiduz.github.io/collab-prezo/collab.html

NOTIFICATIONS

15 of 18

3/1/14, 9:07 AM
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
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
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

More Related Content

Similar to Collab - A dja

Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programsBadoo Development
 
GroongaアプリケーションをDockerコンテナ化して配布する
GroongaアプリケーションをDockerコンテナ化して配布するGroongaアプリケーションをDockerコンテナ化して配布する
GroongaアプリケーションをDockerコンテナ化して配布するongaeshi
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsJames Williams
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Design and Evolution of cyber-dojo
Design and Evolution of cyber-dojoDesign and Evolution of cyber-dojo
Design and Evolution of cyber-dojoJon Jagger
 
Lean agile 2019 - part 4
Lean agile 2019  - part 4Lean agile 2019  - part 4
Lean agile 2019 - part 4Diego Pacheco
 
CGo for fun and profit
CGo for fun and profitCGo for fun and profit
CGo for fun and profitLiz Frost
 
The Django ORM: Common patterns, gotchas, and neat tricks
The Django ORM: Common patterns, gotchas, and neat tricksThe Django ORM: Common patterns, gotchas, and neat tricks
The Django ORM: Common patterns, gotchas, and neat tricksJoey Wilhelm
 
SaaS Boilerplate.pptx
SaaS Boilerplate.pptxSaaS Boilerplate.pptx
SaaS Boilerplate.pptxDuyKhi8
 

Similar to Collab - A dja (13)

How to ros
How to rosHow to ros
How to ros
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
Devops stack
Devops stackDevops stack
Devops stack
 
GroongaアプリケーションをDockerコンテナ化して配布する
GroongaアプリケーションをDockerコンテナ化して配布するGroongaアプリケーションをDockerコンテナ化して配布する
GroongaアプリケーションをDockerコンテナ化して配布する
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
 
Django firebird project
Django firebird projectDjango firebird project
Django firebird project
 
Automate Yo' Self
Automate Yo' SelfAutomate Yo' Self
Automate Yo' Self
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Design and Evolution of cyber-dojo
Design and Evolution of cyber-dojoDesign and Evolution of cyber-dojo
Design and Evolution of cyber-dojo
 
Lean agile 2019 - part 4
Lean agile 2019  - part 4Lean agile 2019  - part 4
Lean agile 2019 - part 4
 
CGo for fun and profit
CGo for fun and profitCGo for fun and profit
CGo for fun and profit
 
The Django ORM: Common patterns, gotchas, and neat tricks
The Django ORM: Common patterns, gotchas, and neat tricksThe Django ORM: Common patterns, gotchas, and neat tricks
The Django ORM: Common patterns, gotchas, and neat tricks
 
SaaS Boilerplate.pptx
SaaS Boilerplate.pptxSaaS Boilerplate.pptx
SaaS Boilerplate.pptx
 

Collab - A dja

  • 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