Re: Django Rest Framework support for Django 4.2

2024-01-04 Thread Priyanka Sharma
EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST ='smtp.gmail.com'
EMAIL_USE_TLS=True
EMAIL_PORT=587
EMAIL_HOST_USER=<"my_gmail">
EMAIL_HOST_PASSWORD=<"app_password">

 smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. For more
information, go to\n5.7.0  https://support.google.com/mail/?p=WantAuthError
q36-20020a635c2400b005ce979b861dsm4765154pgb.84 - gsmtp', '
smtp.gmail.com')

Can someone help me with this?
I'm getting this error

On Thu, 6 Jul, 2023, 9:01 pm Alex Clough,  wrote:

> Thanks, Carlos!
>
> On Thursday, July 6, 2023 at 11:06:26 AM UTC-4 croch...@gmail.com wrote:
>
>> i think yes!
>>
>> On Thu, Jul 6, 2023 at 9:03 AM Alex Clough 
>> wrote:
>>
>>> Hello Carlos,
>>>
>>> So, just to clarify, if I am pinning Django 4.2.3 (latest release) and
>>> DRF 3.14.0 (latest release) in a requirements file, I will be good to go?
>>>
>>> Thank you in advance.
>>>
>>> Alex
>>>
>>> On Friday, May 26, 2023 at 11:45:30 AM UTC-4 croch...@gmail.com wrote:
>>>
 Hi, if you need install the master/main branch you try this
 pip install
 https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
 if you do not want to wait for the tag 3.15

 cheers

 On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov 
 wrote:

> Hey Carlos, thanks for the fast reply!
> Master supports it, but the latest tagged version is 3.14 and it
> doesn't. So my question is when we can expect a new tag (3.15 maybe?)
>
> On Fri, May 26, 2023, 18:25 carlos  wrote:
>
>> Hi, i think DRF now support D4.2
>> https://github.com/encode/django-rest-framework#requirements
>>
>> Cheers
>>
>> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
>> wrote:
>>
>>> Hello group!
>>>
>>> Django 4.2 is listed as an LTS version in the release notes
>>>  so it seems
>>> like it's the most appropriate version to start projects or upgrade to.
>>>
>>> Does anybody know when the new version of DRF which would support
>>> Django 4.2 is expected?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to django-rest-fram...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> You received this message because you are subscribed to a topic in
>> the Google Groups "Django REST framework" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> django-rest-fram...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-rest-fram...@googlegroups.com.
>
 To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
> 
> .
>


 --
 att.
 Carlos Rocha

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-fram...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/99d523ce-88cb-4ff6-ba4d-f746a8d8f620n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> 

Re: Django Rest Framework support for Django 4.2

2023-07-06 Thread Alex Clough
Thanks, Carlos!

On Thursday, July 6, 2023 at 11:06:26 AM UTC-4 croch...@gmail.com wrote:

> i think yes!
>
> On Thu, Jul 6, 2023 at 9:03 AM Alex Clough  
> wrote:
>
>> Hello Carlos,
>>
>> So, just to clarify, if I am pinning Django 4.2.3 (latest release) and 
>> DRF 3.14.0 (latest release) in a requirements file, I will be good to go?
>>
>> Thank you in advance.
>>
>> Alex
>>
>> On Friday, May 26, 2023 at 11:45:30 AM UTC-4 croch...@gmail.com wrote:
>>
>>> Hi, if you need install the master/main branch you try this
>>> pip install 
>>> https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
>>> if you do not want to wait for the tag 3.15
>>>
>>> cheers
>>>
>>> On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov  
>>> wrote:
>>>
 Hey Carlos, thanks for the fast reply!
 Master supports it, but the latest tagged version is 3.14 and it 
 doesn't. So my question is when we can expect a new tag (3.15 maybe?)

 On Fri, May 26, 2023, 18:25 carlos  wrote:

> Hi, i think DRF now support D4.2 
> https://github.com/encode/django-rest-framework#requirements
>
> Cheers
>
> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov  
> wrote:
>
>> Hello group!
>>
>> Django 4.2 is listed as an LTS version in the release notes 
>>  so it seems 
>> like it's the most appropriate version to start projects or upgrade to.
>>
>> Does anybody know when the new version of DRF which would support 
>> Django 4.2 is expected?
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to django-rest-fram...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> att.
> Carlos Rocha
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "Django REST framework" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to 
> django-rest-fram...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
>  
> 
> .
>
 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django REST framework" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-rest-fram...@googlegroups.com.

>>> To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
  
 
 .

>>>
>>>
>>> -- 
>>> att.
>>> Carlos Rocha
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-fram...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-rest-framework/99d523ce-88cb-4ff6-ba4d-f746a8d8f620n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> att.
> Carlos Rocha
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/a0720e48-f81f-4c10-832b-d532385ce006n%40googlegroups.com.


Re: Django Rest Framework support for Django 4.2

2023-07-06 Thread carlos
i think yes!

On Thu, Jul 6, 2023 at 9:03 AM Alex Clough 
wrote:

> Hello Carlos,
>
> So, just to clarify, if I am pinning Django 4.2.3 (latest release) and DRF
> 3.14.0 (latest release) in a requirements file, I will be good to go?
>
> Thank you in advance.
>
> Alex
>
> On Friday, May 26, 2023 at 11:45:30 AM UTC-4 croch...@gmail.com wrote:
>
>> Hi, if you need install the master/main branch you try this
>> pip install
>> https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
>> if you do not want to wait for the tag 3.15
>>
>> cheers
>>
>> On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov 
>> wrote:
>>
>>> Hey Carlos, thanks for the fast reply!
>>> Master supports it, but the latest tagged version is 3.14 and it
>>> doesn't. So my question is when we can expect a new tag (3.15 maybe?)
>>>
>>> On Fri, May 26, 2023, 18:25 carlos  wrote:
>>>
 Hi, i think DRF now support D4.2
 https://github.com/encode/django-rest-framework#requirements

 Cheers

 On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
 wrote:

> Hello group!
>
> Django 4.2 is listed as an LTS version in the release notes
>  so it seems
> like it's the most appropriate version to start projects or upgrade to.
>
> Does anybody know when the new version of DRF which would support
> Django 4.2 is expected?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-rest-fram...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
> 
> .
>


 --
 att.
 Carlos Rocha

 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Django REST framework" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 django-rest-fram...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-fram...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/99d523ce-88cb-4ff6-ba4d-f746a8d8f620n%40googlegroups.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO31jo3qj8uyx%3Dxu1U1MOtAFD63G9M3zQgaqBKuCZ8Ljfw%40mail.gmail.com.


Re: Django Rest Framework support for Django 4.2

2023-07-06 Thread Alex Clough
Hello Carlos,

So, just to clarify, if I am pinning Django 4.2.3 (latest release) and DRF 
3.14.0 (latest release) in a requirements file, I will be good to go?

Thank you in advance.

Alex

On Friday, May 26, 2023 at 11:45:30 AM UTC-4 croch...@gmail.com wrote:

> Hi, if you need install the master/main branch you try this
> pip install 
> https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
> if you do not want to wait for the tag 3.15
>
> cheers
>
> On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov  wrote:
>
>> Hey Carlos, thanks for the fast reply!
>> Master supports it, but the latest tagged version is 3.14 and it doesn't. 
>> So my question is when we can expect a new tag (3.15 maybe?)
>>
>> On Fri, May 26, 2023, 18:25 carlos  wrote:
>>
>>> Hi, i think DRF now support D4.2 
>>> https://github.com/encode/django-rest-framework#requirements
>>>
>>> Cheers
>>>
>>> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov  
>>> wrote:
>>>
 Hello group!

 Django 4.2 is listed as an LTS version in the release notes 
  so it seems like 
 it's the most appropriate version to start projects or upgrade to.

 Does anybody know when the new version of DRF which would support 
 Django 4.2 is expected?

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django REST framework" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-rest-fram...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>> att.
>>> Carlos Rocha
>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Django REST framework" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> django-rest-fram...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-fram...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> att.
> Carlos Rocha
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/99d523ce-88cb-4ff6-ba4d-f746a8d8f620n%40googlegroups.com.


Re: Django Rest Framework support for Django 4.2

2023-05-26 Thread carlos
Hi, if you need install the master/main branch you try this
pip install
https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
if you do not want to wait for the tag 3.15

cheers

On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov 
wrote:

> Hey Carlos, thanks for the fast reply!
> Master supports it, but the latest tagged version is 3.14 and it doesn't.
> So my question is when we can expect a new tag (3.15 maybe?)
>
> On Fri, May 26, 2023, 18:25 carlos  wrote:
>
>> Hi, i think DRF now support D4.2
>> https://github.com/encode/django-rest-framework#requirements
>>
>> Cheers
>>
>> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
>> wrote:
>>
>>> Hello group!
>>>
>>> Django 4.2 is listed as an LTS version in the release notes
>>>  so it seems like
>>> it's the most appropriate version to start projects or upgrade to.
>>>
>>> Does anybody know when the new version of DRF which would support Django
>>> 4.2 is expected?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-framework+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django REST framework" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> django-rest-framework+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO1n0N-GwUoMRzGuYOs%2BZK1_TFhcr_VvKnqPHF7DqrMSHg%40mail.gmail.com.


Re: Django Rest Framework support for Django 4.2

2023-05-26 Thread Vitan Ivanov
Hey Carlos, thanks for the fast reply!
Master supports it, but the latest tagged version is 3.14 and it doesn't.
So my question is when we can expect a new tag (3.15 maybe?)

On Fri, May 26, 2023, 18:25 carlos  wrote:

> Hi, i think DRF now support D4.2
> https://github.com/encode/django-rest-framework#requirements
>
> Cheers
>
> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
> wrote:
>
>> Hello group!
>>
>> Django 4.2 is listed as an LTS version in the release notes
>>  so it seems like
>> it's the most appropriate version to start projects or upgrade to.
>>
>> Does anybody know when the new version of DRF which would support Django
>> 4.2 is expected?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-rest-framework+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> att.
> Carlos Rocha
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django REST framework" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com.


Re: Django Rest Framework support for Django 4.2

2023-05-26 Thread carlos
Hi, i think DRF now support D4.2
https://github.com/encode/django-rest-framework#requirements

Cheers

On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
wrote:

> Hello group!
>
> Django 4.2 is listed as an LTS version in the release notes
>  so it seems like
> it's the most appropriate version to start projects or upgrade to.
>
> Does anybody know when the new version of DRF which would support Django
> 4.2 is expected?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com.


Re: Django Rest Framework Validation Order Issue

2020-07-01 Thread Brent O'Connor
Hi Özgür,

I'm not sure if you saw it or not but I did come up with a solution in 
another branch 
(https://github.com/epicserve/drf-validation-issue/blob/fix-validation/pizzas/serializers.py)
 
and I did end up overriding *run_validation* and *to_internal_value*. If I 
can find time, I think I'll look into putting my solution into a fork of 
DRF and just see what might break when I run tests. It doesn't seem like 
anything would break, but I'm not confident that is the case.

On Wednesday, July 1, 2020 at 6:02:53 AM UTC-5, Özgür Akçalı wrote:
>
> I think you also need to override *run_validators *method in your example 
> project for it to work as you expect, just like you did for 
> *to_internal_value. 
> *If a validation error is raised fom run_validators method, *validate *method 
> is not called, so you can not aggregate any possible errors raised from 
> validation checks in that method.
>
> Also, with this flow, you should take care not to raise validation errors 
> in your custom *validate *methods one by one, but aggregate them and 
> raise them or return them together there as well.
>
> On Wednesday, July 1, 2020 at 1:45:00 PM UTC+3, Özgür Akçalı wrote:
>>
>> Though you can not achieve what you want by just overriding *validate, *and 
>> not overriding *run_validation*. 
>>
>> This would be a major change in DRF though, as with the current behavior, 
>> when you write your *validate *method, you can assume other validations 
>> passed, so I imagine changing this behavior as default now would break a 
>> lot of existing code. I think this would fit better as an optional 
>> addition, maybe with a configuration option on existing serializer classes, 
>> or with a different set of serializer classes.
>>
>> On Wednesday, July 1, 2020 at 1:59:33 AM UTC+3, Brent O'Connor wrote:
>>>
>>> I guess my point is that I don't feel like I should have to override 
>>> anything and this should be DRF's default behavior.  Thank you for 
>>> pointing out that `validation` should be the method that should be used. 
>>>
>>> On Tue, Jun 30, 2020, 5:42 PM Carl Nobile  wrote:
>>>
 Brent, overriding the 'to_internal_value' method is normal and 
 encouraged, however, the 'run_validation' shouldn't generally be 
 overridden, what you can override is the 'validate' method which is called 
 by 'run_validation'.
 ~Carl

 On Tue, Jun 30, 2020 at 5:51 PM Brent O'Connor  
 wrote:

> For anyone that might come across this thread, I went ahead and 
> created an issue 
>  for 
> this on Github.
>
> On Friday, June 26, 2020 at 5:08:03 PM UTC-5, Brent O'Connor wrote:
>>
>> I created an example project 
>>  to illustrate 
>> this issue, but basically if you have custom validation logic on a 
>> serializer and the data has a field that isn't valid, then the errors 
>> raised are only the field level errors and not the custom validation 
>> logic 
>> errors. This ends up being a bad user experience because the user can 
>> fix 
>> the field error and then when post another request they can end up 
>> getting 
>> errors thrown in the custom validation. I'm thinking this might need to 
>> be 
>> an issue added the DRF project on Github, but thought I would check here 
>> first. Please see the project example for more details.
>>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-rest-framework/ea8a9b5d-a671-42b4-9cee-043f28f8efa3o%40googlegroups.com
>  
> 
> .
>


 -- 

 ---
 Carl J. Nobile (Software Engineer)
 carl@gmail.com

 ---

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django REST framework" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-rest-framework+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQL2UvWyjr6UgK%2BpCDexAc%2BC%2BeBUGxAwZYyaxC3dJYwGsQ%40mail.gmail.com
  
 

Re: Django Rest Framework Validation Order Issue

2020-07-01 Thread Özgür Akçalı
I think you also need to override *run_validators *method in your example 
project for it to work as you expect, just like you did for *to_internal_value. 
*If a validation error is raised fom run_validators method, *validate *method 
is not called, so you can not aggregate any possible errors raised from 
validation checks in that method.

Also, with this flow, you should take care not to raise validation errors 
in your custom *validate *methods one by one, but aggregate them and raise 
them or return them together there as well.

On Wednesday, July 1, 2020 at 1:45:00 PM UTC+3, Özgür Akçalı wrote:
>
> Though you can not achieve what you want by just overriding *validate, *and 
> not overriding *run_validation*. 
>
> This would be a major change in DRF though, as with the current behavior, 
> when you write your *validate *method, you can assume other validations 
> passed, so I imagine changing this behavior as default now would break a 
> lot of existing code. I think this would fit better as an optional 
> addition, maybe with a configuration option on existing serializer classes, 
> or with a different set of serializer classes.
>
> On Wednesday, July 1, 2020 at 1:59:33 AM UTC+3, Brent O'Connor wrote:
>>
>> I guess my point is that I don't feel like I should have to override 
>> anything and this should be DRF's default behavior.  Thank you for 
>> pointing out that `validation` should be the method that should be used. 
>>
>> On Tue, Jun 30, 2020, 5:42 PM Carl Nobile  wrote:
>>
>>> Brent, overriding the 'to_internal_value' method is normal and 
>>> encouraged, however, the 'run_validation' shouldn't generally be 
>>> overridden, what you can override is the 'validate' method which is called 
>>> by 'run_validation'.
>>> ~Carl
>>>
>>> On Tue, Jun 30, 2020 at 5:51 PM Brent O'Connor  
>>> wrote:
>>>
 For anyone that might come across this thread, I went ahead and created an 
 issue  
 for this on Github.

 On Friday, June 26, 2020 at 5:08:03 PM UTC-5, Brent O'Connor wrote:
>
> I created an example project 
>  to illustrate 
> this issue, but basically if you have custom validation logic on a 
> serializer and the data has a field that isn't valid, then the errors 
> raised are only the field level errors and not the custom validation 
> logic 
> errors. This ends up being a bad user experience because the user can fix 
> the field error and then when post another request they can end up 
> getting 
> errors thrown in the custom validation. I'm thinking this might need to 
> be 
> an issue added the DRF project on Github, but thought I would check here 
> first. Please see the project example for more details.
>
 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django REST framework" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-rest-framework+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-rest-framework/ea8a9b5d-a671-42b4-9cee-043f28f8efa3o%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>>
>>> ---
>>> Carl J. Nobile (Software Engineer)
>>> carl@gmail.com
>>>
>>> ---
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-rest-framework+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQL2UvWyjr6UgK%2BpCDexAc%2BC%2BeBUGxAwZYyaxC3dJYwGsQ%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/86b2a1e3-21cf-466a-920c-4645b8125af4o%40googlegroups.com.


Re: Django Rest Framework Validation Order Issue

2020-06-30 Thread Brent O'Connor
I guess my point is that I don't feel like I should have to override
anything and this should be DRF's default behavior.  Thank you for
pointing out that `validation` should be the method that should be used.

On Tue, Jun 30, 2020, 5:42 PM Carl Nobile  wrote:

> Brent, overriding the 'to_internal_value' method is normal and encouraged,
> however, the 'run_validation' shouldn't generally be overridden, what you
> can override is the 'validate' method which is called by 'run_validation'.
> ~Carl
>
> On Tue, Jun 30, 2020 at 5:51 PM Brent O'Connor 
> wrote:
>
>> For anyone that might come across this thread, I went ahead and created an
>> issue  for
>> this on Github.
>>
>> On Friday, June 26, 2020 at 5:08:03 PM UTC-5, Brent O'Connor wrote:
>>>
>>> I created an example project
>>>  to illustrate this
>>> issue, but basically if you have custom validation logic on a serializer
>>> and the data has a field that isn't valid, then the errors raised are only
>>> the field level errors and not the custom validation logic errors. This
>>> ends up being a bad user experience because the user can fix the field
>>> error and then when post another request they can end up getting errors
>>> thrown in the custom validation. I'm thinking this might need to be an
>>> issue added the DRF project on Github, but thought I would check here
>>> first. Please see the project example for more details.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-rest-framework+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/ea8a9b5d-a671-42b4-9cee-043f28f8efa3o%40googlegroups.com
>> 
>> .
>>
>
>
> --
>
> ---
> Carl J. Nobile (Software Engineer)
> carl.nob...@gmail.com
>
> ---
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQL2UvWyjr6UgK%2BpCDexAc%2BC%2BeBUGxAwZYyaxC3dJYwGsQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CA%2Bx7ZMp9HOprA-aUjP93s02BVLmMyz8%3DwKrGZjgA2gPAh2ExJg%40mail.gmail.com.


Re: Django Rest Framework Validation Order Issue

2020-06-30 Thread Carl Nobile
Brent, overriding the 'to_internal_value' method is normal and encouraged,
however, the 'run_validation' shouldn't generally be overridden, what you
can override is the 'validate' method which is called by 'run_validation'.
~Carl

On Tue, Jun 30, 2020 at 5:51 PM Brent O'Connor  wrote:

> For anyone that might come across this thread, I went ahead and created an
> issue  for
> this on Github.
>
> On Friday, June 26, 2020 at 5:08:03 PM UTC-5, Brent O'Connor wrote:
>>
>> I created an example project
>>  to illustrate this
>> issue, but basically if you have custom validation logic on a serializer
>> and the data has a field that isn't valid, then the errors raised are only
>> the field level errors and not the custom validation logic errors. This
>> ends up being a bad user experience because the user can fix the field
>> error and then when post another request they can end up getting errors
>> thrown in the custom validation. I'm thinking this might need to be an
>> issue added the DRF project on Github, but thought I would check here
>> first. Please see the project example for more details.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/ea8a9b5d-a671-42b4-9cee-043f28f8efa3o%40googlegroups.com
> 
> .
>


-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQL2UvWyjr6UgK%2BpCDexAc%2BC%2BeBUGxAwZYyaxC3dJYwGsQ%40mail.gmail.com.


Re: Django Rest Framework Validation Order Issue

2020-06-30 Thread Brent O'Connor
For anyone that might come across this thread, I went ahead and created an 
issue  for 
this on Github.

On Friday, June 26, 2020 at 5:08:03 PM UTC-5, Brent O'Connor wrote:
>
> I created an example project 
>  to illustrate this 
> issue, but basically if you have custom validation logic on a serializer 
> and the data has a field that isn't valid, then the errors raised are only 
> the field level errors and not the custom validation logic errors. This 
> ends up being a bad user experience because the user can fix the field 
> error and then when post another request they can end up getting errors 
> thrown in the custom validation. I'm thinking this might need to be an 
> issue added the DRF project on Github, but thought I would check here 
> first. Please see the project example for more details.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/ea8a9b5d-a671-42b4-9cee-043f28f8efa3o%40googlegroups.com.


Re: Django Rest Framework Validation Order Issue

2020-06-29 Thread Brent O'Connor
I understand that you can go about solving it this way, but it seems like a 
lot of extra work when it just works the way you would expect on a Django 
ModelForm. I'm guessing this isn't possible for it to "just work", so I 
might end up making an issue in the DRF project.

On Saturday, June 27, 2020 at 3:34:05 PM UTC-5, Carl Nobile wrote:
>
> Then write your custom validation as a field validator and put them all in 
> the list in the order you want them to fire off in or you could include the 
> field validator checks into your custom validation method.
> The problem is that DRF can only implement what the common cases are, not 
> all the edge cases people may need, but the hooks are there in the code to 
> customize it the way you want.
>
>
> On Sat, Jun 27, 2020 at 4:05 PM Brent O'Connor  > wrote:
>
>> Unfortunately, that doesn't really solve the issue because you want 
>> field-level validation to run because you want to make sure that valid 
>> numbers, etc. are being sent to the API.
>>
>> On Sat, Jun 27, 2020 at 12:25 PM Carl Nobile > > wrote:
>>
>>> It is possible to turn off the built infield errors. The empty list 
>>> essentially turns off al field validation. If there are multiple and you 
>>> don't want all turned off you would need to specify them yourself.
>>>
>>> Class SomeSeializer(...):
>>>
>>> class Meta:
>>> extra_kwargs = { 
>>>'field_name': {'validators': []}, 
>>>}
>>>
>>> On Fri, Jun 26, 2020 at 6:08 PM Brent O'Connor >> > wrote:
>>>
 I created an example project 
  to illustrate this 
 issue, but basically if you have custom validation logic on a serializer 
 and the data has a field that isn't valid, then the errors raised are only 
 the field level errors and not the custom validation logic errors. This 
 ends up being a bad user experience because the user can fix the field 
 error and then when post another request they can end up getting errors 
 thrown in the custom validation. I'm thinking this might need to be an 
 issue added the DRF project on Github, but thought I would check here 
 first. Please see the project example for more details.

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django REST framework" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-rest-framework+unsubscr...@googlegroups.com 
 .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-rest-framework/121a7ebe-4b34-4197-be60-1178730361f7o%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>>
>>> ---
>>> Carl J. Nobile (Software Engineer)
>>> carl@gmail.com 
>>>
>>> ---
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-rest-framework+unsubscr...@googlegroups.com 
>>> .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQ%2BOzPQ-Xuad4OboE-%2BgXF_-uAkuxF%2B9XT5jLPiAnFJfog%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-framework+unsubscr...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-rest-framework/CA%2Bx7ZMq7iMmi4PaQ9aBjGaEybKWH0piWumZTOOfR5-wJOBwwZw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
>
> ---
> Carl J. Nobile (Software Engineer)
> carl@gmail.com 
>
> ---
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Django Rest Framework Validation Order Issue

2020-06-27 Thread Brent O'Connor
Unfortunately, that doesn't really solve the issue because you want
field-level validation to run because you want to make sure that valid
numbers, etc. are being sent to the API.

On Sat, Jun 27, 2020 at 12:25 PM Carl Nobile  wrote:

> It is possible to turn off the built infield errors. The empty list
> essentially turns off al field validation. If there are multiple and you
> don't want all turned off you would need to specify them yourself.
>
> Class SomeSeializer(...):
>
> class Meta:
> extra_kwargs = {
>'field_name': {'validators': []},
>}
>
> On Fri, Jun 26, 2020 at 6:08 PM Brent O'Connor 
> wrote:
>
>> I created an example project
>>  to illustrate this
>> issue, but basically if you have custom validation logic on a serializer
>> and the data has a field that isn't valid, then the errors raised are only
>> the field level errors and not the custom validation logic errors. This
>> ends up being a bad user experience because the user can fix the field
>> error and then when post another request they can end up getting errors
>> thrown in the custom validation. I'm thinking this might need to be an
>> issue added the DRF project on Github, but thought I would check here
>> first. Please see the project example for more details.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-rest-framework+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/121a7ebe-4b34-4197-be60-1178730361f7o%40googlegroups.com
>> 
>> .
>>
>
>
> --
>
> ---
> Carl J. Nobile (Software Engineer)
> carl.nob...@gmail.com
>
> ---
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQ%2BOzPQ-Xuad4OboE-%2BgXF_-uAkuxF%2B9XT5jLPiAnFJfog%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CA%2Bx7ZMq7iMmi4PaQ9aBjGaEybKWH0piWumZTOOfR5-wJOBwwZw%40mail.gmail.com.


Re: Django Rest Framework JWT - OperationalError: no such table: auth_user

2019-01-28 Thread El_merendero
Hi Arthur,
first of all, thanks for your reply, it seems to work. I'm using Django 
1.11.2 and in my settings.py I already had `django.contrib.auth` app in my 
`INSTALLED_APPS`. Anyway I tryed to ran the migrate command and now I don't 
get that Exception any more but an "User doesn't exist." error.

If is not a problem, I ask you another question: my final target is to 
verify a JWT without the username information. I'm documenting about 
"Django REST framework JWT" and I think that it only expects to receive a 
JWT with username (it has the user checker method indeed). Can you tell me 
if there is a configuration or a different tool to perform this target?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework JWT - OperationalError: no such table: auth_user

2019-01-28 Thread Arthur Rio
Hi,

Given you are using python 2.7, I suppose that you are using Django < 1.11.
It seems like you either didn’t add the `django.contrib.auth` app to your
`INSTALLED_APPS` (
https://docs.djangoproject.com/en/1.11/topics/auth/#installation) or
haven’t ran the `./manage.py migrate` command.

Hope this help.

Regards


—
Arthur

On January 28, 2019 at 3:29:47 PM, El_merendero (carlopole...@gmail.com)
wrote:

Hi all,
I'm developing a Django application for Windows with Pyhton 2.7.15. I need
to implement an authentication mechanism with Django REST Framework JWT
 where I simply need
to verify a token (and not to generate it). The token's payload is
something like this:

{
  "iss": "customIssuer",
  "username": "customUser"
}

For this reason, I configure my setting.py in this way:

...

REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
'rest_framework.authentication.TokenAuthentication'
),
}


JWT_AUTH = {
'JWT_ISSUER': 'customIssuer'
}


...

and my urls.py in this way:

...


from rest_framework_jwt.views import verify_jwt_token


urlpatterns = [
...
url(r'^api-token-verify/', verify_jwt_token),
...
]

Then, if I try to send a POST request with the above token, I get this
error:

Traceback (most recent call last):
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\core\handlers\exception.py"
, line 41, in inner
response = get_response(request)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\core\handlers\base.py"
, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\core\handlers\base.py"
, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\views\decorators\csrf.py"
, line 58, in wrapped_view
return view_func(*args, **kwargs)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\views\generic\base.py"
, line 68, in view
return self.dispatch(request, *args, **kwargs)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework\views.py",
line 489, in dispatch
response = self.handle_exception(exc)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework\views.py",
line 449, in handle_exception
self.raise_uncaught_exception(exc)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework\views.py",
line 486, in dispatch
response = handler(request, *args, **kwargs)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework_jwt\views.py"
, line 57, in post
if serializer.is_valid():
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework\serializers.py"
, line 237, in is_valid
self._validated_data = self.run_validation(self.initial_data)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework\serializers.py"
, line 435, in run_validation
value = self.validate(value)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework_jwt\serializers.py"
, line 130, in validate
user = self._check_user(payload=payload)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\rest_framework_jwt\serializers.py"
, line 109, in _check_user
user = User.objects.get_by_natural_key(username)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\contrib\auth\base_user.py"
, line 48, in get_by_natural_key
return self.get(**{self.model.USERNAME_FIELD: username})
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\manager.py"
, line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\query.py",
line 374, in get
num = len(clone)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\query.py",
line 232, in __len__
self._fetch_all()
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\query.py",
line 1105, in _fetch_all
self._result_cache = list(self._iterable_class(self))
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\query.py",
line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File
"C:\Software\Workspace\py2_env\lib\site-packages\django\db\models\sql\compiler.py"
, line 886, in execute_sql
raise original_exception
OperationalError: no such table: auth_user

Checking the "rest framework jwt" package, I notice that this error is
throw by serializers.py. In particular from the check_user method:

def _check_user(self, payload):


username = jwt_get_username_from_payload(payload)


if not username:
msg = _('Invalid payload.')

Re: Django Rest Framework File Upload

2018-04-30 Thread ray
Thanks, but then blog explains what i've already done. You enter the fields 
explicitly. What i need is when you upload a file, the API extracts the 
package name  and package_version_code and displays as shown in the image 
above.

Any idea how i should modify the serializer?

Thanks.

On Monday, 30 April 2018 19:49:06 UTC+1, Prasanna Balaraman wrote:
>
> Follow the steps mentioned in this blog and you should be able to 
> accomplish it.
>
> https://blog.vivekshukla.xyz/uploading-file-using-api-django-rest-framework/
>
> Thanks,
>
> [image: freshworks-dew.png]
>
> Prasanna Balaraman
>
> Team Enabler
>
> p : +91-9940112996
>
> e : prasanna@freshworks.com 
>
> w : www.freshworks.com 
>
> [image: fb.png]  [image: twitter.png] 
>  [image: linkedin.png] 
> 
>
>  
>
>
> On Mon, Apr 30, 2018 at 11:50 PM ray  
> wrote:
>
>> Hi everyone.I need to upload a file using the Rest Framework API.Im 
>> looking to extract then list the metadata (package_name & package version 
>> code) from an android application(apk file).
>>
>> This is what i have so far 
>>
>>
>> 
>> Here is my code so far. I can only do this through the admin, but i want 
>> it in such a way that when when file is uploaded,the serializer can 
>> get/extract the fields(package_name & package version code).
>>
>>
>> models.py
>>
>> from django.db import models 
>>
>> class Applist(models.Model): 
>> application = models.FileField(upload_to = 'uploads/') 
>> package_name = models.CharField(max_length=200) 
>> package_version_code = models.IntegerField(default=0)
>>
>>
>> serializers.py
>>
>>
>>
>> import os 
>> from rest_framework import serializersfrom . import models
>>
>>
>> class FileUploaderSerializer(serializers.ModelSerializer):
>> class Meta:
>> model = models.Applist
>> fields = ('application', 'package_name', 'package_version_code',)
>>
>> def validate(self, validated_data):
>> validated_data['name'] = 
>> os.path.splitext(validated_data['file'].name)[0]
>> #other validation logic
>> return validated_data
>>
>> def create(self, validated_data):
>> return FileUploader.objects.create(**validated_data)
>>
>>
>>
>>
>>
>>
>> views.py
>>
>>
>> from rest_framework import viewsetsfrom rest_framework.parsers import 
>> FormParser, MultiPartParser
>>
>> from . import modelsfrom . import serializers
>>
>>
>>
>> class FileUploaderViewSet(viewsets.ModelViewSet):
>> serializer_class = serializers.FileUploaderSerializer
>> parser_classes = (MultiPartParser, FormParser,)
>> queryset = models.Applist.objects.all()
>>
>> def get_queryset(self, *args, **kwargs):
>> qs = super(FileUploaderViewSet, self).get_queryset(*args, **kwargs)
>> # qs = qs.filter(owner=self.request.user)
>> return qs
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-framework+unsubscr...@googlegroups.com 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework File Upload

2018-04-30 Thread Prasanna Balaraman
Follow the steps mentioned in this blog and you should be able to
accomplish it.
https://blog.vivekshukla.xyz/uploading-file-using-api-django-rest-framework/

Thanks,

[image: freshworks-dew.png]

Prasanna Balaraman

Team Enabler

p : +91-9940112996

e : prasanna.balara...@freshworks.com

w : www.freshworks.com 

[image: fb.png]  [image: twitter.png]
 [image: linkedin.png]





On Mon, Apr 30, 2018 at 11:50 PM ray  wrote:

> Hi everyone.I need to upload a file using the Rest Framework API.Im
> looking to extract then list the metadata (package_name & package version
> code) from an android application(apk file).
>
> This is what i have so far
>
>
> 
> Here is my code so far. I can only do this through the admin, but i want
> it in such a way that when when file is uploaded,the serializer can
> get/extract the fields(package_name & package version code).
>
>
> models.py
>
> from django.db import models
>
> class Applist(models.Model):
> application = models.FileField(upload_to = 'uploads/')
> package_name = models.CharField(max_length=200)
> package_version_code = models.IntegerField(default=0)
>
>
> serializers.py
>
>
>
> import os
> from rest_framework import serializersfrom . import models
>
>
> class FileUploaderSerializer(serializers.ModelSerializer):
> class Meta:
> model = models.Applist
> fields = ('application', 'package_name', 'package_version_code',)
>
> def validate(self, validated_data):
> validated_data['name'] = 
> os.path.splitext(validated_data['file'].name)[0]
> #other validation logic
> return validated_data
>
> def create(self, validated_data):
> return FileUploader.objects.create(**validated_data)
>
>
>
>
>
>
> views.py
>
>
> from rest_framework import viewsetsfrom rest_framework.parsers import 
> FormParser, MultiPartParser
>
> from . import modelsfrom . import serializers
>
>
>
> class FileUploaderViewSet(viewsets.ModelViewSet):
> serializer_class = serializers.FileUploaderSerializer
> parser_classes = (MultiPartParser, FormParser,)
> queryset = models.Applist.objects.all()
>
> def get_queryset(self, *args, **kwargs):
> qs = super(FileUploaderViewSet, self).get_queryset(*args, **kwargs)
> # qs = qs.filter(owner=self.request.user)
> return qs
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django REST Framework

2018-01-30 Thread Cynthia Simiyu
Okay 

On Tuesday, January 30, 2018 at 1:09:56 PM UTC+3, Xavier Ordoquy wrote:
>
> This was a compatibility layer to be compatible with Django < 1.10. Since 
> it’s not supported any longer it has been removed.
>
> Le 30 janv. 2018 à 11:06, Xavier Ordoquy  > a écrit :
>
> Hi,
>
> I don’t think it ever had. What are you referring to ?
>
> Regards,
> Xavier.
>
> Le 30 janv. 2018 à 11:03, Cynthia Simiyu  > a écrit :
>
> compat.py missing def set_many in version 3.7.7, why?
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-rest-framework+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-rest-framework+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django REST Framework

2018-01-30 Thread Xavier Ordoquy
This was a compatibility layer to be compatible with Django < 1.10. Since it’s 
not supported any longer it has been removed.

> Le 30 janv. 2018 à 11:06, Xavier Ordoquy  a écrit :
> 
> Hi,
> 
> I don’t think it ever had. What are you referring to ?
> 
> Regards,
> Xavier.
> 
>> Le 30 janv. 2018 à 11:03, Cynthia Simiyu > > a écrit :
>> 
>> compat.py missing def set_many in version 3.7.7, why?
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django REST framework" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-rest-framework+unsubscr...@googlegroups.com 
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-rest-framework+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP


Re: Django REST Framework

2018-01-30 Thread Xavier Ordoquy
Hi,

I don’t think it ever had. What are you referring to ?

Regards,
Xavier.

> Le 30 janv. 2018 à 11:03, Cynthia Simiyu  a 
> écrit :
> 
> compat.py missing def set_many in version 3.7.7, why?
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-rest-framework+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP


Re: Django rest framework serializer.save() return “Invalid data. Expected a dictionary, but got group”

2017-11-07 Thread Chris Foresman
It might help to see how your models are arranged, but are you trying to 
_create_ a new Log that has a specific group attached to it? Because the 
serializer you've defined doesn't handle that case, I don't think. But, try 
this:

data = {
   "group": {
   "id": group.pk,
   "name": group.name,
   },
   # other relavant fields here
}



On Monday, November 6, 2017 at 10:22:00 PM UTC-6, Gary Ng wrote:
>
> There is a route /group/task, every time it is called, the log will be 
> generated.
>
> This is views.py
>
> class GroupViewSet(viewsets.ViewSet):
> 
> @detail_route(methods=['post'], url_path='task')
> def get_task(self, request, pk=None):
> group = get_object_or_404(Group, pk=pk)
> #group = ServerSerializer(group) <--- tried but not work
>
> data = {
> "group": group,
> #"group": group.data, <--- tried but not work
> }
> log_serializer = LogSerializer(data=data)
> if log_serializer.is_valid(raise_exception=True):
> log_serializer.save()
>
>
> This is serializer.py
>
> class GroupSerializer(serializers.ModelSerializer):
> class Meta:
> model = Group
> fields = ('id', 'name')
>
> class LogSerializer(serializers.ModelSerializer):
> group = GroupSerializer()
> class Meta:
> model = Log
> fields = ('group', 'created')
>
>
> The post responese:
>
> {
> "group": {
> "non_field_errors": [
> "Invalid data. Expected a dictionary, but got group."
> ]
> }}
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django rest framework request data is always null

2017-03-13 Thread Jani Tiainen

Hi,

Looks like your code that calls POST data is incorrect. As you see in 
printout for some reason included data is strangely wrapped as an object 
to toplevel item_id.



On 10.03.2017 15:27, Sandesh Naroju wrote:
I just want to try simple Django rest framework code, I used APIVIEW 
and posted data through browser.


CODE:

class GetData(APIView):

def post(self, request, format=None):
if request.method == 'POST':
item_id = request.data.get('item_id')
return Response({"return": "OK ","item_id":item_id})
else:
return Response({"return": "NOT OK "})


The above code should echo the item_id whatever i "POST"ed. but the 
result is always null.


POST data:

{
 "item_id" : "3456787"
}

result:

{
"item_id":null,
"return" :"OK "
}

I don't understand where I went wrong. the above code works fine in my 
loaclhost but does not work in production server.


I tried to print request.data which gives me this

{ "item_id": { "_content_type": "application/json", "_content": 
"{\r\n\r\n\"item_id\" : \"3456787\"\r\n\r\n}" }, "return": "OK " }


--
You received this message because you are subscribed to the Google 
Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-rest-framework+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework Temperature Data Querying

2017-01-04 Thread Marco Silva
On a custom serializer field, (eg SerializerMethodField) use the django
aggregate functions for max and min
https://docs.djangoproject.com/en/1.10/topics/db/aggregation/

On Wed, 4 Jan 2017, 11:59 Burak Özdemir,  wrote:

> There are lots of temperature data for one day. For instance, there are
> nearly 5000 records for 03 January. I want to get highest and lowest of
> these records for one specific day.
>
> 4 Ocak 2017 Çarşamba 14:43:55 UTC+3 tarihinde Marco Silva yazdı:
>
> Actually, I  think he wants a custom serializer that has one of 2 get
> arguments(start and end date) and then generates the desired json with
> fields using the django aggregate methods
>
> On Tue, 3 Jan 2017, 22:43 gordon,  wrote:
>
> List_route or detail route decorators sounds like what you are looking for
> http://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing
>
> On Jan 3, 2017 5:09 AM, "Burak Özdemir"  wrote:
>
> I want to create an API endpoint for daily temperatures.(highest and
> lowest tempereture of a day).
>
> 3 Ocak 2017 Salı 13:06:03 UTC+3 tarihinde Marco Silva yazdı:
>
> What exactly do you need help in?
>
>
> segunda-feira, 2 de Janeiro de 2017 às 22:16:24 UTC, Burak Özdemir
> escreveu:
>
> My sensor measures the temperature value every 5 seconds and records it to
> the database. I want to see the highest and lowest temperature of every
> recorded day via API. It should be like that(for instance, values are not
> correct):
> 
>
> The modal:
>
> class SensorModel(models.Model):
> measurementTime = models.DateTimeField()
> ldr = models.IntegerField()
> temperature = models.IntegerField()
> humidity = models.IntegerField()
>
> class Meta:
> ordering = ['measurementTime']
>
> def __unicode__(self):
> return str(self.id)
>
>
>
> Database:
>
> 
>
> Current API:
>
> 
>
> Thanks in advance.
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django REST framework" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-rest-framework/bhGJR4tndMc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django REST framework" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-rest-framework/bhGJR4tndMc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework Temperature Data Querying

2017-01-04 Thread Burak Özdemir
There are lots of temperature data for one day. For instance, there are 
nearly 5000 records for 03 January. I want to get highest and lowest of 
these records for one specific day.

4 Ocak 2017 Çarşamba 14:43:55 UTC+3 tarihinde Marco Silva yazdı:
>
> Actually, I  think he wants a custom serializer that has one of 2 get 
> arguments(start and end date) and then generates the desired json with 
> fields using the django aggregate methods
>
> On Tue, 3 Jan 2017, 22:43 gordon,  wrote:
>
>> List_route or detail route decorators sounds like what you are looking 
>> for 
>> http://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing
>>
>> On Jan 3, 2017 5:09 AM, "Burak Özdemir" > > wrote:
>>
>>> I want to create an API endpoint for daily temperatures.(highest and 
>>> lowest tempereture of a day).
>>>
>>> 3 Ocak 2017 Salı 13:06:03 UTC+3 tarihinde Marco Silva yazdı:

 What exactly do you need help in?


 segunda-feira, 2 de Janeiro de 2017 às 22:16:24 UTC, Burak Özdemir 
 escreveu:
>
> My sensor measures the temperature value every 5 seconds and records 
> it to the database. I want to see the highest and lowest temperature of 
> every recorded day via API. It should be like that(for instance, values 
> are 
> not correct):  
> 
>
> The modal:
>
> class SensorModel(models.Model):
> measurementTime = models.DateTimeField()
> ldr = models.IntegerField()
> temperature = models.IntegerField()
> humidity = models.IntegerField()
>
> class Meta:
> ordering = ['measurementTime']
>
> def __unicode__(self):
> return str(self.id)
>
>
>
> Database:
>
> 
>
> Current API: 
>
> 
>
> Thanks in advance.
>
>
> -- 
>>>
>> You received this message because you are subscribed to the Google Groups 
>>> "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-rest-framework+unsubscr...@googlegroups.com 
>>> .
>>
>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django REST framework" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-rest-framework/bhGJR4tndMc/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> django-rest-framework+unsubscr...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework Temperature Data Querying

2017-01-04 Thread Marco Silva
Actually, I  think he wants a custom serializer that has one of 2 get
arguments(start and end date) and then generates the desired json with
fields using the django aggregate methods

On Tue, 3 Jan 2017, 22:43 gordon,  wrote:

> List_route or detail route decorators sounds like what you are looking for
> http://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing
>
> On Jan 3, 2017 5:09 AM, "Burak Özdemir"  wrote:
>
> I want to create an API endpoint for daily temperatures.(highest and
> lowest tempereture of a day).
>
> 3 Ocak 2017 Salı 13:06:03 UTC+3 tarihinde Marco Silva yazdı:
>
> What exactly do you need help in?
>
>
> segunda-feira, 2 de Janeiro de 2017 às 22:16:24 UTC, Burak Özdemir
> escreveu:
>
> My sensor measures the temperature value every 5 seconds and records it to
> the database. I want to see the highest and lowest temperature of every
> recorded day via API. It should be like that(for instance, values are not
> correct):
> 
>
> The modal:
>
> class SensorModel(models.Model):
> measurementTime = models.DateTimeField()
> ldr = models.IntegerField()
> temperature = models.IntegerField()
> humidity = models.IntegerField()
>
> class Meta:
> ordering = ['measurementTime']
>
> def __unicode__(self):
> return str(self.id)
>
>
>
> Database:
>
> 
>
> Current API:
>
> 
>
> Thanks in advance.
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django REST framework" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-rest-framework/bhGJR4tndMc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-rest-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework Temperature Data Querying

2017-01-03 Thread Burak Özdemir
I want to create an API endpoint for daily temperatures.(highest and lowest 
tempereture of a day).

3 Ocak 2017 Salı 13:06:03 UTC+3 tarihinde Marco Silva yazdı:
>
> What exactly do you need help in?
>
>
> segunda-feira, 2 de Janeiro de 2017 às 22:16:24 UTC, Burak Özdemir 
> escreveu:
>>
>> My sensor measures the temperature value every 5 seconds and records it 
>> to the database. I want to see the highest and lowest temperature of every 
>> recorded day via API. It should be like that(for instance, values are not 
>> correct):  
>> 
>>
>> The modal:
>>
>> class SensorModel(models.Model):
>> measurementTime = models.DateTimeField()
>> ldr = models.IntegerField()
>> temperature = models.IntegerField()
>> humidity = models.IntegerField()
>>
>> class Meta:
>> ordering = ['measurementTime']
>>
>> def __unicode__(self):
>> return str(self.id)
>>
>>
>>
>> Database:
>>
>> 
>>
>> Current API: 
>>
>> 
>>
>> Thanks in advance.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework - Could not resolve URL for hyperlinked relationship using view name “field-detail”

2016-11-14 Thread Bernardo Garcia
I understand. Thanks Xavier This works for me :)

On Monday, November 14, 2016 at 5:14:55 AM UTC-5, Xavier Ordoquy wrote:
>
> Hi,
>
> You declared your view as "fields" in the routers, so you should use 
> "fields-detail" as the view name for the hyperlink.
>
> Regards,
> Xavier,
> Linovia.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework - Could not resolve URL for hyperlinked relationship using view name “field-detail”

2016-11-14 Thread Xavier Ordoquy
Hi,

You declared your view as "fields" in the routers, so you should use 
"fields-detail" as the view name for the hyperlink.

Regards,
Xavier,
Linovia.

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.