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 3:55

Hahaha. Shit me, awesome.

http://www.imageput.com/hosted/19679holyshit.png

Where did this syntax highlighting come from? Firefox 3.0?

<code><br/>
class Message(models.Model):<br/>
&nbsp;&nbsp;&nbsp; sender = models.ForeignKey(Player, related_name='sent_message')<br/>
&nbsp;&nbsp;&nbsp; receiver = models.ForeignKey(Player, related_name='received_message')<br/>
&nbsp;&nbsp;&nbsp; subject = models.CharField(max_length=80)<br/>

&nbsp;&nbsp;&nbsp; body = models.TextField()<br/>
&nbsp;&nbsp;&nbsp; date = models.DateTimeField()</code>


Fuck yeah! It's highlighting <code> tags. Why was I not informed?

I wonder how it detects the language used. Probably falls back to "highlight strings and numbers".

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