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-11 17:17

I thought you came up with the model?

Name: Anonymous 2008-06-11 17:22

I did, but Django bitched about not having "related_name" for the sender/receiver, which I'd never seen before, so I just put in that.

Name: Anonymous 2008-06-11 17:24

http://www.djangoproject.com/documentation/db-api/#related-objects

If you're not willing to actually learn Django in the process, what's the point?

Name: Anonymous 2008-06-11 17:35

>>4
Whoa, thanks, I get it now.

Name: Anonymous 2008-06-12 1:44

Name: Anonymous 2008-06-12 1:51

Posting in a thread likely to be read by an internet celebrity.

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".

Name: Anonymous 2008-06-12 3:57

>>8
Ohhh. It's a /prog/ script. Fantastic!

Name: Anonymous 2008-06-12 3:59

http://dis.4chan.org/script/prettify.js

zomg added in my browser as a global script

Name: Anonymous 2008-06-12 4:01


test = do
    x <- (+5)  <$> getTime
    y <- (+10) <$> getTime
    let list = zip [x, y] [print "apa", print "bepa"]
    forM_ list $ \(t, f) -> do
      now <- getTime
      print . unwords . map show $ [x, y, now, t]
      sleep . fromIntegral $ t - now
      f
      print =<< getTime

Name: Mr VacBob 2008-06-12 4:06 (capped)

Name: Anonymous 2008-06-12 4:09

Hmm.

(define (foo x y)
  (let ((a 1)
        (b 2))
    (if (= a x)
        (print a)
        (print y))))

Name: Anonymous 2008-06-12 4:13

>>13
not bad really. just needs LET, DEFINE, etc. probably doesn't do quotes well.

(eval '(hai guyz))

Name: Anonymous 2008-06-12 4:15

pity it doesn't support [code lang="whatever"][/code], but n/m.
let's see what we can do here for lisp...

Name: Anonymous 2008-06-12 4:47

meh I can't be bothered reading through this javascript code

Name: Anonymous 2008-06-12 5:15

>>12
Y HALO THAR!

Good to see some familiar guys lurking /prog/

Name: Anonymous 2008-06-12 7:37

>>14
Then use (eval (quote (hai guyz)))

Name: Anonymous 2008-06-12 7:49

(eval `(hai guyz))

Name: Anonymous 2008-06-12 8:31

>>18
lol yeah cause I write scheme code just for /prog/

Name: Anonymous 2008-06-12 9:48

I'd rather see VacBob-sama ban all of these anus haxers.

Name: Anonymous 2008-06-12 11:07

I'd rather see bob sakamato

Name: Anonymous 2008-06-12 12:08

>>21
That's MrVacBob-sama to you, cretin.

Name: Anonymous 2008-06-12 12:31

>>23
You can't do that.

Name: Anonymous 2008-06-12 12:51

*grabs dick*

Name: Anonymous 2008-06-12 16:26

>>17,21,23
Boot-licking fags.

Name: Anonymous 2008-06-12 16:47

>>20
Erm... Why are you using that syntactic sugar anyway? (quote) is much nicer.

Name: Anonymous 2008-06-12 18:58

>>27
Erm... I disagree. The syntactic sugar for QUOTE is better than writing it explicitly.

Name: Anonymous 2008-06-12 19:01

>>27 probably prefers call-with-current-continuation to call/cc.

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.

Name: Anonymous 2008-06-12 19:21

>>30
THAT'S WHAT YOUR MOTHER SAID

Name: Anonymous 2008-06-12 19:21

>>31
OH SHIT I MEANT-

Name: Anonymous 2008-06-12 19:22

I SAID THAT TO YOUR MOTHER. ABOUT MY PENIS

Name: Anonymous 2008-06-12 19:58

>>33
Stop trying to salvage the joke. It's dead, Jim.

Name: Anonymous 2008-06-12 21:42

>>34
THAT'S WHAT YOUR MOTHER SAID

Name: Anonymous 2008-06-12 22:57

Name: Anonymous 2008-06-13 5:19

>>34
I wish. It's machine code. It can never die.

Name: Anonymous 2008-06-13 9:58

>>30
No, if the length bothers you, you have to change your text editor.

Name: Anonymous 2008-06-13 11:34

>>38
Wise words from a wise dipshit.

Name: Anonymous 2008-06-13 14:14

>>39
Learn English.
dipshit
usually vulgar : a stupid or incompetent person

wise
characterized by wisdom : marked by deep understanding, keen discernment, and a capacity for sound judgment

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