On Sun, Nov 2, 2008 at 4:52 AM, void <[EMAIL PROTECTED]> wrote:
>
> Can someone point to the correct way to do this?
>
> Suppose i'm working in a tumblelog, it's basically , 4 o 5 tipes of
> "post item" that share some cmmon information.
>
> So the first approach i would go is:
>
> cllass Post(models.Model):
>   here goes common metada of all things that can be "posted" like
> taggin , dates, etc
>
> class TextPost(Post)
>  This model inherits all the metadata of the "normal" posteable
> objects and add some of it's own like
>
>  text = TexField()
>
> also we can provide a ImagePost(Post) with the same characteristics as
> textpost,
>
> The caveat folllow:
>
> Inheritance gives me a reference in the "child" model to the pk of the
> parent, that's ok.
> But i have no way of iterating to Posts elements and instantiating
> them osr seeing their attrs without knowing the correct nadme.
>
> Is any correct way to do this? will i have to hack django (or add a
> field) that backreferences the reference?
>
> The idea is traverse only the Posts objects instead o N tables (1 for
> each kinkd of post)
>

See this thread for some ideas:

http://groups.google.com/group/django-users/browse_thread/thread/f4241bc16455f92d/dcd2bfcc91d99cc9

-- 
 Ramiro Morales

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to