Hi folks,
  I'm trying to write a basic chat application.

  my models currently look like

***********
# models.py

from google.appengine.ext import db

class Chat(db.Model):
    name = db.StringProperty

class User(db.Model):
    name = db.StringProperty()
    ip = db.StringProperty()

class Message(db.Model):
    chat = db.ReferenceProperty(Chat, required=True,
collection_name='chat')
    by = db.ReferenceProperty(User, required=True,
collection_name='by')
    date = db.DateTimeProperty(auto_now_add=True)
    message = db.StringProperty(multiline=True)

from google.appengine.ext.db import djangoforms
#from django import newforms as forms

class MessageForm(djangoforms.ModelForm):
    class Meta:
        model = Message

***********

  What I want is to have the message itself submitted via the form,
but to populate the 'by' and 'chat' parameters.

  I figure the form will submit some sort of chatId and userId.  I'll
need to map those across to User and Chat models.  Add them to the
Message model, and then I'm ready to save.

  How should I go about this?

Cheers,
Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to