Hi,

I have an Objects Model and a Tags Model with a M2M relationship
between them. I want to update info about the tags of the object
visited by the user updating it everytime the user requests an Object.
Is it a crazy idea? I want to know wich tags are the most viewed by the
user and wich are the most recent he has view so that I can recommend
him Objects that have also such tags (objects that are related to the
ones he is interested in).

This is my main idea how the models should be:
===================================

class MyObject(models.Model):
   tags = models.ManyToManyField(Tag)
   etc.................

class Tag(models.Model):
   etc...............

class RelationModel(models.Model):
   my_object = models.ForeignKey(MyObject)
   tag = models.ForeignKey(Tag)
   times_viewed = models.PositiveIntegerField()
   latest_view= models.DateTimeField()

Problems I see:
===========
- Lets say I have 30 tags for each object, I need to create_or_update
30 rows everytime a user requests an object. That could be a bottleneck
:(
- The relation table can be very big: 100.000 users x 2.000 tags each
user = 200.000.000 rows in the relation table!!!! I should limit it to
lets say 50 tags per user and in each update overwrite the less viewed
and older tags with the new ones. -> more updates on every request :S
- Is this the better way to do what I want to do?

Any ideas?

Thank you for your help.


--~--~---------~--~----~------------~-------~--~----~
 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