Your SlideShare is downloading. ×
0
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
django.contrib.databrowse
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

django.contrib.databrowse

2,916

Published on

Slides for my django.contrib.databrowse presentation given at BayPIGgies on 2009-Oct-22.

Slides for my django.contrib.databrowse presentation given at BayPIGgies on 2009-Oct-22.

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,916
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. django.contrib.databrowse
  • 2. whoami: Eddy Mulyono <ul><li>lazy
  • 3. magic-removal
  • 4. MS in CS thesis </li><ul><li>need quick UI </li></ul></ul>
  • 5. who: Survey <ul><li>Use databrowse
  • 6. Hack databrowse </li></ul>
  • 7. Outline <ul><li>Intro
  • 8. Docs
  • 9. Demo
  • 10. Dive </li></ul>
  • 11. django.contrib.admin <ul><li>RW
  • 12. RO? </li></ul>
  • 13. django.contrib.databrowse
  • 14. INSTALL <ul><li>admin </li></ul><ul><li>databrowse </li></ul>
  • 15. INSTALLED_APPS <ul><li>django.contrib.admin </li></ul><ul><li>django.contrib. databrowse </li></ul>
  • 16. urls.py <ul><li>from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # … (r'^admin/', include(admin.site.urls)), </li></ul><ul><li>from django.contrib import databrowse urlpatterns = patterns('', # … (r'^databrowse/(.*)', databrowse.site.root) , </li></ul>
  • 17. register <ul><li>from mysite.polls.models import Poll from django.contrib import admin admin.site.register(Poll) </li></ul><ul><li>from myapp.models import SomeModel, SomeOtherModel from django.contrib import databrowse databrowse.site. register(SomeModel) databrowse.site. register(SomeOtherModel) </li></ul>
  • 18. (teaser)
  • 19. Multi-site <ul><li>admin.site </li><ul><li>admin/__init__.py: </li><ul><li>from django.contrib.admin.sites import AdminSite, site </li></ul><li>admin/sites.py: </li><ul><li>site = AdminSite() </li></ul></ul><li>site2 = admin.sites. AdminSite() </li></ul><ul><li>databrowse.site </li><ul><li>databrowse/__init__.py: </li><ul><li>from django.contrib.databrowse.sites import DatabrowsePlugin, ModelDatabrowse, DatabrowseSite, site </li></ul><li>databrowse/sites.py: </li><ul><li>site = DatabrowseSite() </li></ul></ul><li>site2 = databrowse.sites. DatabrowseSite() </li></ul>
  • 20. Customize <ul><li>ModelAdmin </li><ul><li>admin.site.register(Poll, PollAdmin) </li></ul></ul><ul><li>ModelDatabrowse </li><ul><li>databrowse.site. register(SomeModel, SomeModelDatabrowse) </li></ul></ul>
  • 21. databrowse.ModelDatabrowse <ul><li>plugins </li><ul><li>class DefaultModelDatabrowse(ModelDatabrowse): plugins = {'objects': ObjectDetailPlugin(), 'calendars': CalendarPlugin(), 'fields': FieldChoicePlugin()} </li></ul></ul>
  • 22. databrowse.plugins <ul><li>ObjectDetailPlugin
  • 23. CalendarPlugin
  • 24. FieldChoicePlugin </li></ul>
  • 25. databrowse.DatabrowsePlugin <ul><li>model_index_html
  • 26. model_view </li></ul>
  • 27. absolute_url <ul><li>get_absolute_url </li><ul><li>return ('databrowse', ('polls/poll/objects/%i/' % self.pk,), {}) </li></ul></ul>
  • 28. Q&A
  • 29. references <ul><li>http://docs.djangoproject.com/en/1.1/ref/contrib/databrowse/
  • 30. Pictures </li><ul><li>http://www.flickr.com/photos/stinajonsson/3932774410/
  • 31. http://www.flickr.com/photos/daveknapik/3280194084/
  • 32. http://www.flickr.com/photos/endlessstudio/3861211128/
  • 33. http://press.absolut.com/
  • 34. http://www.flickr.com/photos/oberazzi/318947873/ </li></ul></ul>

×