Server working

This commit is contained in:
Chris Proctor
2024-05-19 19:26:23 -04:00
parent b5950eeb28
commit 780c1e581a
7 changed files with 361 additions and 19 deletions

View File

@@ -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,
}