
from django.db import models


class DeviceManager(models.Manager):

    def latest(self):
        """ Returns latest Device instance """
        return self.latest('created_at')



from django.db import models


class DeviceManager(models.Manager):

    def get_latest(self):
        """ Returns latest Device instance """
        return self.get_queryset().latest('created_at')


Use .get_latest() instead so that we do not override built-in .latest()
Use .get_latest() instead so that we do not override built-in .latest()
