These are chat archives for django/django
datetimeFielddo not forget that we have
timezone. Therefore your best practice is showing the
datetimeField, but omit the day. And be caution on timezone.
DateFieldmostly where I want to omit day. I do realise the advantages of using naive
DateFieldand not 2 intigerfields (or such) for
month; hence I asked whether there is an open source, properly tested,
MonthYearfield which inherits from
DateFieldbut always puts
day=1. I don't want to go ahead and make db field, widget and form field for this from scratch as I will, most likely, mess some part up that will catch up with me later on, and most likely if something like this already exists.
can anyone tell me why it doesn't return me collections when i call API ?
class CollectionSerializer(serializers.ModelSerializer): class Meta: model = Collection fields = ('id', 'title') class FolderSerializer(serializers.ModelSerializer): collections = CollectionSerializer(many= True, read_only=True) class Meta: model = Folder fields = ('id', 'title', 'collections')
``` folder = models.ForeignKey(Folder, null = True, blank=True, on_delete=models.SET_NULL, related_name='collections') ```