Re: Simplest way to get all models for which admin interface exists

2012-03-15 Thread Gelonida N
Thanks a lot Matt,

On 03/15/2012 03:20 AM, Matt Schinckel wrote:
> All installed ModelAdmin models:
> 
 from django.contrib.admin import site
 site._registry.keys()
> 
> If you only got at this from `manage.py shell`, then you may need to
> import your urls.py file first.
> 
> Getting those that are not registered is a bit longer:
> 
 from django.db.models import get_models
 from django.conf import settings
 set(get_models()).difference(site._registry.keys())
> 
Exactly what I was looking for.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: Simplest way to get all models for which admin interface exists

2012-03-14 Thread Matt Schinckel
All installed ModelAdmin models:

>>> from django.contrib.admin import site
>>> site._registry.keys()

If you only got at this from `manage.py shell`, then you may need to import 
your urls.py file first.

Getting those that are not registered is a bit longer:

>>> from django.db.models import get_models
>>> from django.conf import settings
>>> set(get_models()).difference(site._registry.keys())

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QZ2pV8Mj240J.
To post to this group, send email to django-users@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.



Simplest way to get all models for which admin interface exists

2012-03-14 Thread Gelonida N
Hi,

Title says it all.

What is the simplest way to get a list of models for which an admin
interface exists?


I'd also be interested in getting a list of all models for which no
admin interface exists.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.