These are chat archives for django/django

22nd
Feb 2018
Pierre Sigwalt
@pierresigwalt
Feb 22 2018 05:45

Hi,
I have started a django project, all url are working except few ones, I got the following error
'many' is an invalid keyword argument for this function

What is it stand for, I don't use any <many> keywords in my models .

omid zarinmahd
@zarinpy
Feb 22 2018 05:47
I think it is not about models
What are the urls ?
Pierre Sigwalt
@pierresigwalt
Feb 22 2018 05:48
router.register(r'uex/v1/uex-emails', b_views.UexEmailViewSet)
router.register(r'uex/v1/claims-status', b_views.ClaimStatusViewSet)
the view set look like:
class UexEmailViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows product to be viewed or edited.
    """
    queryset         = UexEmail.objects.all()
    serializer_class = UexEmail
Model
class UexEmail(models.Model):
    email_template      = models.TextField(null = False)
    email_code          = models.CharField(null = False, max_length = 255)
    email_subject       = models.CharField(null = False, max_length = 255)
    email_configuration = JSONField(null = True)
    email_created_date  = models.DateTimeField(default = timezone.now)
    email_updated_date  = models.DateTimeField(auto_now_add = True, null = True)

    class Meta:
        app_label = 'baymax'
omid zarinmahd
@zarinpy
Feb 22 2018 05:58
May be you use <many> in your serikizer class
Serializer
Pierre Sigwalt
@pierresigwalt
Feb 22 2018 05:59
class EmailSerializer(serializers.ModelSerializer):
    class Meta:
        model  = Email
        fields = '__all__'
omid zarinmahd
@zarinpy
Feb 22 2018 05:59
Did you search in your project ?!
Pierre Sigwalt
@pierresigwalt
Feb 22 2018 06:01
I checked, I haven't used it
Sorry
class UexEmailSerializer(serializers.ModelSerializer):
    class Meta:
        model  = UexEmail
        fields = '__all__'
prinxy
@prinxy
Feb 22 2018 08:45

Hello all, i am prinx .
I asked few weeks back for suggestions on how to learn django, and this beautiful community came up with lovely suggestions, one of which was i should follow the official tutorial from 1 to 7, which i have done...
Please all i will be glad if you can point a direction on how to improve my skills... any suggestions will be appreciated...

Thanks all in anticipation....

Renato César
@rencesar
Feb 22 2018 08:52
Try to do your own project, put what do you learn in practice, and when do you start will come new questions new problems and it's in this moment that you learn more.
If you found any problem on your way it's completely normal and you can ask here or stackoverflow. But be careful with the date of some solutions hahahah
prinxy
@prinxy
Feb 22 2018 08:55
Thanks @rencesar ... Suggestion duly appreciated
Renato César
@rencesar
Feb 22 2018 15:23
@prinxy If you need any help I will be glad in help you or anyone!
Thomas Haller
@SurfingNerd
Feb 22 2018 19:25

Hello,
have a problem with django-rules.
someone has an idea?

File "/tmp/pip-build-xtniax7g/django-rules/setup.py", line 6, in <module>
reload(sys).setdefaultencoding("UTF-8")
NameError: name 'reload' is not defined

tried to install over pip:
sudo pip install django-rules

tried it also with --no-cache-dir and --isolated.

pip 9.0.1
Python 3.6.4

Muhammad
@mraza007
Feb 22 2018 23:39
Hi channel I am looking for django helo
help