# Path: django_eventstream/event.py
# class Event(object):
# 	def __init__(self, channel, type, data, id=None):
# 		self.channel = channel
# 		self.type = type
# 		self.data = data
# 		self.id = id


import sys
import json
import datetime
from django.utils import timezone
from django.core.serializers.json import DjangoJSONEncoder
from .event import Event
		from . import models
		from . import models
		from . import models
		from . import models
		raise NotImplementedError()

	def get_events(self, channel, last_id, limit=100):
		raise NotImplementedError()

	def get_current_id(self, channel):
		raise NotImplementedError()

class DjangoModelStorage(StorageBase):
	def append_event(self, channel, event_type, data):

		db_event = models.Event(
			channel=channel,
			type=event_type,
			data=json.dumps(data, cls=DjangoJSONEncoder))
		db_event.save()

		self.trim_event_log()

		e = Event(
			db_event.channel,
			db_event.type,
			data,
			id=db_event.eid)

		return e

	def get_events(self, channel, last_id, limit=100):

		if is_python3:

# Path: django_eventstream/event.py
# class Event(object):
# 	def __init__(self, channel, type, data, id=None):
# 		self.channel = channel
# 		self.type = type
# 		self.data = data
# 		self.id = id


# Path: django_eventstream/storage.py
import sys
import json
import datetime
from django.utils import timezone
from django.core.serializers.json import DjangoJSONEncoder
from .event import Event
		from . import models
		from . import models
		from . import models
		from . import models

		raise NotImplementedError()

	def get_events(self, channel, last_id, limit=100):
		raise NotImplementedError()

	def get_current_id(self, channel):
		raise NotImplementedError()

class DjangoModelStorage(StorageBase):
	def append_event(self, channel, event_type, data):

		db_event = models.Event(
			channel=channel,
			type=event_type,
			data=json.dumps(data, cls=DjangoJSONEncoder))
		db_event.save()

		self.trim_event_log()

		e = Event(
			db_event.channel,
			db_event.type,
			data,
			id=db_event.eid)

		return e

	def get_events(self, channel, last_id, limit=100):

		if is_python3:

			assert(isinstance(last_id, int))