Is there any advantage/disadvantage to using cache.get_model() vs.
models.get_model() in an admin.py file? I'm assuming that
cache.get_model() provides quicker access, but just wanted to see if
there were any drawbacks.

A simple example of each usage is below:

from django.contrib import admin
from django.db.models import get_model

...
model admin code here
...

admin.site.register(get_model('app', 'model), MyModelAdmin)

OR

from django.contrib import admin
from django.db.models.loading import cache

...
model admin code here
...

admin.site.register(cache.get_model('app', 'model), MyModelAdmin)

Thanks in advance!
Rich

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to