You are on the right track investigating the ContentType app. -n
On Aug 6, 11:51 pm, chyea <ryanc...@unt.edu> wrote: > Hi all, > > I recently sent an email to another Django coder asking for some > possible feedback on my situation. I'll simply restate the email here, > because I figured why not ask a bunch of other Django coders, too! > Here it goes... > > Hi, > > I'm trying to design a django-based gaming news site, and have been > just confusing myself. I think I'm over-complicating it by trying to > make it highly dynamic/scalable. Perhaps I can just run my design > ideas by you and see if you have any feedback for me. > > Conceptually, it's very simple. I want the site to revolve around > various types of articles - news, interviews, reviews. My thoughts > were that all of these articles are essentially, at the core, the same > set of data - a title, slug and the article text (simplified example). > So, with this in mind I created an abstract base class called Article, > with those essential elements. Then, I just created classes for News, > Interview and Review, that subclass the abstract Article base class. > So, now I've got the core article model classes for my site. > > I'm starting to confuse myself, though, when trying to figure out what > to do with all the media involved with the site. > > How I have it invisioned is a highly dynamic and scalable setup that > allows me to tag any number of pictures, videos, or any other model > really, to any type of Article object. This would result in media > objects that aren't exactly coupled to any specific Article, and can > therefor be tagged to any of them, none of them, all of them, etc. > > With this in mind, I thought it'd make sense to create another > abstract base class for all types of media. Somehow, this abstract > base class for media objects would contain the proper code that'd > allow any classes that subclass it to be tagged to any other model. > > The reason I'm thinking of it like this is because imagine a page on > my site for a News article object. Lets say this News article is about > how a game developer company is down in profits this year because they > haven't released a game they announced, yet. This News article would > have several things related, or 'tagged' to it - a Developer, a Game, > perhaps some Pictures, maybe a Movie. I'd have existing models for > Developer, Game, Picture and Movie (ideally). While creating this News > article, I'd have the ability to just select these related items in > the admin page. All of this related data would be available to the > News article object when you query for it, and then all passed to the > template where I can sort it out there. > > What I've described above sounds like it'd be a very dynamic setup > that'd allow me to basically create some pretty interesting Articles > and tag them with relevant data. This beats just using TinyMCE and > using the formatting it creates to link to YouTube videos, and images > in my article, on a per-article basis. Does it sounds like I've > thought this to death, or is what I'm describing possible at all? > > All day today I messed around with generic relationships and > ContentType. I tried creating an abstract base classes with generic > relations to other abstract base classes: Article <-> Media > > In the end I'm just high confused and wondering if I'm completely > complicating this. I know this was long and if you read it this far > then I greatly appreciate it. I'm looking forward to any insight, or > advice/feedback you may have! > > Thank you, > Ryan C --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---