Friday, November 29, 2013

django - model for a messaging app between users

How do I go about creating a message app, between users. What's the business logic for creating the model? All I can think of was like this:

models.py

    class Message(models.Model):
        description = models.TextField()
        date_added = models.DateTimeField(default=datetime.now)
        sender = models.ForeignKey(User)
        recipient = models.ForeignKey(User)

I am not very sure if this is the way to go. If you could kindly guide me on how to get started, will be very thank full. Thank you!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHSNPWtZaFs0%2BWSiZKmCnykDRBSo02Uru92_G1yC7ztzjmvjhw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment