Re: Customizing django admin

2010-08-08 Thread yangmin...@gmail.com
there are 2 ways you can do, both are very easy:

1st:  
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#custom-template-options
2nd:  
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates


On Aug 9, 10:18 am, vishy  wrote:
> Hi,
>
> For a modeladmin,I need to show a custom template when user adds or
> edits.How can I go about implementing this functionality?
>
> thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



one inconsistent place between django document and source code.

2010-08-08 Thread yangmin...@gmail.com
Hi All,
When I was reading django document, I also viewed the source code
of the framework to help me understand,
but I found one inconsistent place about urls attribute of
Django's AdminSite object.

# in djangoproject document, 
http://docs.djangoproject.com/en/dev/topics/http/urls/:
 ** This will include the nominated URL patterns into the given
application and instance namespace. For example, the urls attribute of
Django's AdminSite object returns a 3-tuple that contains all the
patterns in an admin site, plus the name of the admin instance, and
the application namespace admin.
# in source code:  /django/contrib/admin/options.py
 def urls(self):
return self.get_urls()
urls = property(urls)
  def get_urls(self):
from django.conf.urls.defaults import patterns, url

def wrap(view):
def wrapper(*args, **kwargs):
return self.admin_site.admin_view(view)(*args,
**kwargs)
return update_wrapper(wrapper, view)

info = self.model._meta.app_label,
self.model._meta.module_name

urlpatterns = patterns('',
url(r'^$',
wrap(self.changelist_view),
name='%s_%s_changelist' % info),
url(r'^add/$',
wrap(self.add_view),
name='%s_%s_add' % info),
url(r'^(.+)/history/$',
wrap(self.history_view),
name='%s_%s_history' % info),
url(r'^(.+)/delete/$',
wrap(self.delete_view),
name='%s_%s_delete' % info),
url(r'^(.+)/$',
wrap(self.change_view),
name='%s_%s_change' % info),
)
return urlpatterns

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: another tutorial for polls...

2009-12-14 Thread yangmin...@gmail.com
great. I just happened to finish reading the poll tutorial in
djangproject.com.
it will be really helpful.

On Dec 15, 6:31 am, Manu  wrote:
> Hi all,
>
> Following the announce of some tools of mine (obviews)... I've just
> add a practical example, inspired from django tutorial on polls.
>
> The theory is on a standalone page describing the views used in this
> simple poll application (http://www.obviews.com/polls/)... Anyhow,
> somones need a few less theory and a bit more show... so you will find
> the real polls onhttp://polls.obviews.com, with (as you guessed) real
> stuff like polls and choices and votes (and code too).
>
> Keep in mind the demo is very simple, its purpose being more a demo...
> than a poll app :)
> Any feedback welcome !
>
> Manu

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.