These are chat archives for django/django
In Django tutorial part 2 we are defining a custom method was_published_recently(self): , which look like this:
class Question(models.Model): # ... def was_published_recently(self): return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
What is self in it?
thisin other languages
list.sort?) and lots of other stuff that makes discovering language a breeze
for obj in data: newmodel = mymodel.objects.create(**obj) # .. #.. serializer = serializer(queryset, many=True) return Response(serializer.data)
polls/static/js? Is there a better practice for shipping reusable Django apps that depend on js libs?
pip intallthis app to not have to worry about including it themselves. But, I could just put it in the
READMEthat this app requires specific libs. Would this be a better practice? Thanks