That's also a good idea. Thanks Jim.
--~--~-~--~~~---~--~~
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
I'm pretty new to python myself, but my favorite way to inspect
objects that I have found so far is the builtin method dir(). As in:
dir(Publisher.objects.get(pk=1))
dir() tells you all of the methods and attributes for a given object,
though it doesn't display the value of attributes.
Thanks everybody, using __dict__ and meta_fields helped but the most
complete data came from the documentation in admin, that's exactly
what I needed :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
You could use this:
Publisher.objects.get(pk=1).__dict__
The admin application is also great for this! :)
Best Regards,
Jesaja Everling
On Aug 21, 10:55 pm, Erik Allik <[EMAIL PROTECTED]> wrote:
> Do you mean something like Publisher._meta.fields?
>
> Erik
>
> On 21.08.2008, at 22:38, Alexis
Do you mean something like Publisher._meta.fields?
Erik
On 21.08.2008, at 22:38, Alexis Bellido wrote:
>
> Hello, I'm reading the Django book and after reviewing the database
> API I was wondering if there was some method to find out which fields
> a model contains.
>
> For example, if I have
On Aug 21, 2:38 pm, Alexis Bellido <[EMAIL PROTECTED]> wrote:
> Hello, I'm reading the Django book and after reviewing the database
> API I was wondering if there was some method to find out which fields
> a model contains.
If I'm understanding the question, why not just use the documentation
Hello, I'm reading the Django book and after reviewing the database
API I was wondering if there was some method to find out which fields
a model contains.
For example, if I have a Publisher model (which translates to a
publisher table in the database) I'm looking for some method in Django
7 matches
Mail list logo