Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from django.db.models import ForeignKey
from mservice_model.models import ServiceModel
from .manager import ThreadManager, MessageManager
from . import mailer
from django.db.models.fields import (AutoField, CharField, TextField)
from mservice_model.options import ServiceOptions
class GmailAutoField(AutoField):
def to_python(self, value):
return value
class Thread(ServiceModel):
_default_manager = ThreadManager
_service_api = mailer.GmailApi("h")
# _meta = ThreadOptions()
class Meta(ServiceOptions):
_service_fields = {
'id': GmailAutoField(),
'to': CharField(max_length=200),
'number_of_messages': CharField(max_length=200),
}
def __init__(self, id=None, to=None, number_of_messages=None):
self.id = id
self.to = to
self.number_of_messages = number_of_messages
@property
def messages(self):