Django-way for building a "News Feed" / "Status update" / "Activity Stream" -


I would like to create a reusable Django app that manages the status updates of users. Much like Facebook's "news feed"

Use cases, for example:

  • Due to a specific date a professor can create assignments and each student
  • New PDF can upload, according to the news feed, with a brief description, due to that date and the link to see the full details
  • Seeks interesting for its students On the news feed, information about this should be displayed, for example For details of the PDF, A link to the link and preview for download .
  • A link youtube video can be posted and a small thumbnail is displayed on the news feed and, with one click, using the video javascript

One concern is how to control different types of updates and display the correct "html snippet" for it. Second, which is more important, this " How to design a model of "Diego Margo".

About the first, I can think of two ways to do this:

  1. Using model succession;
  2. Using normal relationships.

I divorced before posting here, but I could not find anything. I checked pinax to see if they applied it, but they do not. So, here I look here for more tips on how to handle it in another non-hamy manner.

"post-text" itemprop = "text">

I can think of two ways:

First of all, To create Assigments, PdfFiles, and Youtube links, and use the library for it to embed in your news ideas, this is a simple way because you can define the templates, code for each new activity.

The other thing that I think is a class activity :

  class activity (models.Model): date = model. DataTiffField (auto_now_add = true) content_type = model Foranjit (contenttip) object_id = model PositiveIntegerField () content_object = generic Every time you have a new attachment or PDF upload or YouTube link, and each time a class creates a new installation activity for each class. A method like  render_to_html , in this view, in your view, you can do more for activities and the method render_to_html 


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -