List Info

Thread: Re: partial table query




Re: partial table query
country flaguser name
Australia
2007-12-21 04:22:39

On Fri, 2007-12-21 at 02:06 -0800, mark wrote:
> Hi,
> 
> I'am new to django framework.
> 
> as i was looking on the data model each data model is a
class that is
> table in the database.
> 
> my qestion is if i have a table that want to retrive
partial data from
> the table
> 
> Example: (media object)
> 
> table [id, name , description, url , thumbnail ]
> 
> and i also want to cerate an object MediaHeader that
containe only
> [id, name , description]
> and MediaData [id, name , description, url , thumbnail
]
> 
> some my view need to show only the data of MediaHeader
and some of
> them need only MediaData.
> 
> so is there is away to tell the data model to be able
to read from a
> specific table and a specific filed.

See the 'db_column' (part of field definitions) and
'db_table' (part of
a model's Meta class) attributes in the model API
documentation.

http://www.djangoproject.com/documentation/model-api/

Regards,
Malcolm

-- 
Honk if you love peace and quiet. 
http://www.pointy-s
tick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )