

from google.appengine.ext import db


class ExampleModel(db.Model):
    """Example Model"""
    example_name = db.StringProperty(required=True)
    example_description = db.TextProperty(required=True)
    added_by = db.UserProperty()
    timestamp = db.DateTimeProperty(auto_now_add=True)

class RegIDModel(db.Model):
    """Regl IDs Model"""
    regID = db.StringProperty(required=True)

class MessagesModel(db.Model):
	"""Model for storing messages sent"""
	message = db.StringProperty(required=True)
	messagetype = db.StringProperty(required=True)
	added_by = db.UserProperty()
	sent_at = db.DateTimeProperty(auto_now_add=True)


from google.appengine.ext import db


class ExampleModel(db.Model):
    """Example Model"""
    example_name = db.StringProperty(required=True)
    example_description = db.TextProperty(required=True)
    added_by = db.UserProperty()
    timestamp = db.DateTimeProperty(auto_now_add=True)

class RegIDModel(db.Model):
    """Regl IDs Model"""
    regID = db.StringProperty(required=True)

class MessagesModel(db.Model):
	"""Model for storing messages sent"""
	message = db.StringProperty(required=True)
	messagetype = db.StringProperty(required=True)
	added_by = db.UserProperty(auto_current_user=True)
	sent_at = db.DateTimeProperty(auto_now_add=True)
Update user who sent the message
Update user who sent the message

  
  
  from google.appengine.ext import db
  
  
  class ExampleModel(db.Model):
      """Example Model"""
      example_name = db.StringProperty(required=True)
      example_description = db.TextProperty(required=True)
      added_by = db.UserProperty()
      timestamp = db.DateTimeProperty(auto_now_add=True)
  
  class RegIDModel(db.Model):
      """Regl IDs Model"""
      regID = db.StringProperty(required=True)
  
  class MessagesModel(db.Model):
  	"""Model for storing messages sent"""
  	message = db.StringProperty(required=True)
  	messagetype = db.StringProperty(required=True)
- 	added_by = db.UserProperty()
+ 	added_by = db.UserProperty(auto_current_user=True)
  	sent_at = db.DateTimeProperty(auto_now_add=True)
Update user who sent the message
## Code Before:


from google.appengine.ext import db


class ExampleModel(db.Model):
    """Example Model"""
    example_name = db.StringProperty(required=True)
    example_description = db.TextProperty(required=True)
    added_by = db.UserProperty()
    timestamp = db.DateTimeProperty(auto_now_add=True)

class RegIDModel(db.Model):
    """Regl IDs Model"""
    regID = db.StringProperty(required=True)

class MessagesModel(db.Model):
	"""Model for storing messages sent"""
	message = db.StringProperty(required=True)
	messagetype = db.StringProperty(required=True)
	added_by = db.UserProperty()
	sent_at = db.DateTimeProperty(auto_now_add=True)
## Instruction:
Update user who sent the message
## Code After:


from google.appengine.ext import db


class ExampleModel(db.Model):
    """Example Model"""
    example_name = db.StringProperty(required=True)
    example_description = db.TextProperty(required=True)
    added_by = db.UserProperty()
    timestamp = db.DateTimeProperty(auto_now_add=True)

class RegIDModel(db.Model):
    """Regl IDs Model"""
    regID = db.StringProperty(required=True)

class MessagesModel(db.Model):
	"""Model for storing messages sent"""
	message = db.StringProperty(required=True)
	messagetype = db.StringProperty(required=True)
	added_by = db.UserProperty(auto_current_user=True)
	sent_at = db.DateTimeProperty(auto_now_add=True)