alesdotio / django-admin-shortcuts

Add simple and pretty shortcuts to the django admin homepage.
Other
205 stars 53 forks source link

How to set Count and Count new #18

Closed enkhtulga closed 10 years ago

enkhtulga commented 10 years ago

problem3 Hi, When i write like this 'count_new': 'project.utils.count_app_product_product', it comes below result. How to get count of my products. app name: app_product, model name: product

Thanks,

alesdotio commented 10 years ago

Hi! The option should just point to a function in your app that you implement. There is no magic that would automatically count your models. You have to implement the function yourself.

It could look something like this:

def count_my_products():
    return Product.objects.count()
enkhtulga commented 10 years ago

:D Thanks, alesdotio