These are chat archives for django/django

6th
Feb 2018
matrixbot
@matrixbot
Feb 06 2018 06:37
moli Does anyone her have experience to help choose django-shop or django-oscar for a webshop?
JeffZzz
@flyerooo
Feb 06 2018 07:09
class Project(models.Model):
    user = models.ForeignKey(USER)
    status = models.CharField(max_length=100, choices=(('NEW', 'NEW'), ('CLOSE', 'CLOSE'), ('CANCEL', 'CANCEL')))

class Investment(models.Model):
    project = models.ForeignKey(Project)
    status = models.CharField(max_length=100, choices=(('BOOKED', 'BOOKED'), ('FAIL', 'FAIL'), ('CANCEL', 'CANCEL')))

class ProjectSerializer(serializers.ModelSerializer):
    investment = InvestmentSerializer(many=True)
    class Meta:
        model = Project
        fields = ('id', 'status', 'investment')

class ProjectView(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet):
    serializer_class = ProjectSerializer
    def get_queryset(self):
        return Project.objects.filter(user=self.request.user, status__in= ['CLOSE', 'CANCEL'], investment__status__in=["FAIL", "CANCEL"]))
I want a project view, only investment's status is 'FAIL' or 'CANCEL', but above code all investment in the result not only status is 'FAIL' or 'CANCEL', how to do this?
Mukul Agrawal
@mukul09
Feb 06 2018 10:26
@Albertchieng Hey. I am also going to start django project on e-commerce system. So, if you are interested we can discuss about the same.
matrixbot
@matrixbot
Feb 06 2018 15:06
moli Albertchieng (Gitter) Mukul Agrawal (Gitter) : A friend and I are currently trying to get to grips with Django Shop and Oscar.
moli Mukul Agrawal (Gitter) Albertchieng (Gitter) Have you decided which e-commerce project you will use?
Konuko Jodom
@jodom
Feb 06 2018 15:55
Hello awesome people. I've noticed an *issue following the tutorial at https://docs.djangoproject.com/en/2.0/ref/contrib/gis/tutorial/ under the GDAL Interface section, beginning where they mention Layer objects may be sliced: from what I can see in the source of the layer Object, it cannot be sliced this way like a python list. Can someone else reproduce this issue, following the docs. Also, if it is really an issue, where does it need to be raised?
Layer object is defined as class Layer(django.contrib.gis.gdal.base.GDALBase) : django.contrib.gis.gdal.layer.Layer