Re: Accessing Meta properties and a templating question.

2009-07-17 Thread Beetle B.
Russell Keith-Magee wrote: > > 1. In the Python code, how can I access various Meta properties of a > > model (e.g. verbose_name, etc). At the moment, I do it via > > model._meta.verbose_name, but I always get chills down my spine when I > > access properties beginning with a single underscore. Is

Accessing Meta properties and a templating question.

2009-07-17 Thread Beetle B.
Hi, 1. In the Python code, how can I access various Meta properties of a model (e.g. verbose_name, etc). At the moment, I do it via model._meta.verbose_name, but I always get chills down my spine when I access properties beginning with a single underscore. Is there a "proper" way? 2. Can someone

Behavior of add(obj1...) and remove(obj1...)

2008-07-10 Thread Beetle B.
Hi, If I do some_object.users.add(user), it won't complain if the user was already in some_object. Likewise, if I do some_object.users.remove(user), it won't complain if the user was never there. Can I rely on this behavior in the future? I currently do explicit checks: I create a list of all

Re: get_models

2008-06-19 Thread Beetle B.
Thanks for all the replies. Wonder why they didn't add it to the documentation...seems like a useful function. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

get_models

2008-06-19 Thread Beetle B.
Hi, I needed a way to get a list of all models in a Django project. I was told in IRC that I can use get_models from django.db.models. I'm not sure this is documented in the docs. Is it "safe" to use (as in this method and its behavior is not expected to change in the future)? Thanks. --~--~-