Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Django project model design

Name: Anonymous 2008-06-11 17:11

I'm designing a simple text-based game with Django, and I came up with this model for messages sent to/from players.


class Message(models.Model):
    sender = models.ForeignKey(Player, related_name='sent_message')
    receiver = models.ForeignKey(Player, related_name='received_message')
    subject = models.CharField(max_length=80)
    body = models.TextField()
    date = models.DateTimeField()


I'm not sure why "related_name" is needed; can /prog/ explain, and share their thoughts on this model?

Name: Anonymous 2008-06-12 19:20

>>29
I'm not >>27 but I do. If the length bothers you, you probably use it too much.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List