Server working
This commit is contained in:
@@ -7,7 +7,7 @@ from banjo.models import (
|
||||
|
||||
class User(Model):
|
||||
name = StringField(unique=True)
|
||||
public_key = StringField(unique=True)
|
||||
public_key = StringField()
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
@@ -20,3 +20,10 @@ class Message(Model):
|
||||
recipient = ForeignKey(User, related_name="messages_received")
|
||||
ciphertext = StringField()
|
||||
read = BooleanField()
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'sender': self.sender.name,
|
||||
'recipient': self.recipient.name,
|
||||
'ciphertext': self.ciphertext,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user