Re: anyone solve this problem

2021-01-08 Thread Xavier Ordoquy
Hi, The Django REST Framework tutorial, step6 should show you how to do that. The SnippetViewSet uses the SnippetSerializer to set the current user as the owner of the snippet created. Regards, Linovia, Xavier O. > Le 8 janv. 2021 à 12:43, Praveen chaduvala a écrit : > > django - how to add c

Version 3.12.2 now available

2020-11-05 Thread Xavier Ordoquy
Django REST framework 3.12.2 is now available on PyPI. https://pypi.org/project/djangorestframework/ See the release notes for more details: https://www.django-rest-framework.org/community/release-notes/#3122 Thanks to everyon

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Xavier Ordoquy
The question is, what are you trying to do and what outcome are you expecting ? > Le 4 nov. 2020 à 07:28, Ashutosh Mishra a écrit > : > > So how can I resolve this? > > On Wed 4 Nov, 2020, 11:56 Xavier Ordoquy, <mailto:xordo...@linovia.com>> wrote: > Hi, >

Re: 'Article' object is not iterable ,why this error is popping up,while fetching data using primary no

2020-11-03 Thread Xavier Ordoquy
Hi, Please, paste your code in the mail instead of screenshots, it makes it hard to read. In your view, you are passing an Article instance to your serializer along with the many=True keyword which means the serializer will expect an iterable of Articles as the error suggests. Regards, Xavier

Re: rest framework

2020-11-03 Thread Xavier Ordoquy
Hi, Also make sure you install it first. Django REST frameworks kickstart (https://www.django-rest-framework.org/tutorial/quickstart/#project-setup ) should help you get it working. Regards, Xavier O. > Le 3 nov. 2020 à

Re: Django is getting ASYNC, what about DRF ?

2019-11-22 Thread Xavier Ordoquy
What about it ? I don’t think DRF we use anything that is async incompatible outside Django itself. Regards, Xavier O. Linovia. > Le 22 nov. 2019 à 14:10, Dennis a écrit : > > As per Andrew Godwin presentation at DjangoCon2019 the plan is: > - 3.0 --> ASGI server, ASGIHandler > - 3.1 --> Async

Re: [feature request] permission required decorator for drf api views

2019-07-22 Thread Xavier Ordoquy
Hi, Class based views have a permission_classes setting (https://www.django-rest-framework.org/api-guide/permissions/#setting-the-permission-policy ) and function based views have a @permission_classes

Re: perform_create never called, despite being recommended by docs

2019-04-06 Thread Xavier Ordoquy
> Regards, > > Alex > >> On 6 Apr 2019, at 20:43, Xavier Ordoquy > <mailto:xordo...@linovia.com>> wrote: >> >> Hi, >> >> Did you first ensure the client’s request is valid ? What’s the response >> code ? >> Most likely, the requ

Re: perform_create never called, despite being recommended by docs

2019-04-06 Thread Xavier Ordoquy
Hi, Did you first ensure the client’s request is valid ? What’s the response code ? Most likely, the request is invalid preventing the perform_create to be called. Regards, Xavier. > Le 6 avr. 2019 à 20:48, 'Alexander Halford' via Django REST framework > a écrit : > > Here is a link to the co

Re: Composable permissions question

2019-02-22 Thread Xavier Ordoquy
Hi, We might do that but handling None a is side effect that is not supported. Documentation (https://www.django-rest-framework.org/api-guide/permissions/#custom-permissions) says: The methods should return True if the request should be granted access, and False otherwise. Regards, Xavier

Re: Documentation for earlier version of DRF 3.X

2019-01-30 Thread Xavier Ordoquy
Hi, You will need to: - checkout the tag - installing the dependencies found in requirements/requirements-documentation.txt and requirements/requirements-testing.txt - generate the documentation with mkdocs build Regards, Xavier O. > Le 30 janv. 2019 à 12:29, ankGT a écrit : > > I understand

Re: import error in tutorial quickstart

2018-11-29 Thread Xavier Ordoquy
To avoid creating another tutorial directory Regards, Xavier O. > Le 29 nov. 2018 à 18:59, vijay.b.seh...@gmail.com a écrit : > > Why is . used after djan*** tutorial '.' ? > > On Monday, March 13, 2017 at 11:50:08 AM UTC+5:30, Xavier Ordoquy wrote: > Hi mada

Re: Bulk validation and creation

2018-11-19 Thread Xavier Ordoquy
Hi, This is an issue I faced 2 or 3 years ago. I ended up rewriting most of the serializer with custom code. I checked a few things by myself first and used bulk inserts. If everything went fine, good, I could send back how happy the server was within a few seconds. If there was errors, I did fal

Re: Invalid source attribute does not throw an error

2018-11-19 Thread Xavier Ordoquy
t;>> d.a = 1 >>> d.a 1 >>> Regards, Xavier O. > So why this error is not raised? > > Regards > Andi > > Am Donnerstag, 15. November 2018 18:08:36 UTC+1 schrieb Xavier Ordoquy: > Hi, > > There are no errors because the value gets map to the instance’s

Re: Invalid source attribute does not throw an error

2018-11-15 Thread Xavier Ordoquy
Hi, There are no errors because the value gets map to the instance’s « abc ». It could be a property with setters / getters that process the value and fill some of the model’s field (or the other way around). For example, you could have a write only property « password » that takes a password, h

Re: Composable permissions question

2018-10-31 Thread Xavier Ordoquy
Hi, It’s more a bug in DRF. Could you open an issue about that so we can keep it on our radars ? Regards, Xavier, Linovia. > Le 31 oct. 2018 à 19:49, Frank Bohnsack a écrit : > > While trying out the new composable permission feature, I have the following > problem: > > >>> IsAuthenticated &

Re: Basic understanding / custom field - point of access

2018-10-30 Thread Xavier Ordoquy
Hi, It’s a bit more complex than that. Content négociation along with renderers and parsers will move the data from the HTTP body into basic python types (int / floats / strings). Serializers will move those basic types from and to more complex ones (DateTimes, Decimals, Django models / queryse

Re: Advice on disabling validators for Nested serializers

2018-08-18 Thread Xavier Ordoquy
Hi, I wrote about this a while ago. Everything should be explained here: https://medium.com/django-rest-framework/dealing-with-unique-constraints-in-nested-serializers-dade33b831d9 Regards, Xavier O. Linovia. > Le 17 août 2018 à 23:41, Arjun Nambiar a écrit : > > Hi Ryan, > > It is basically

Re: ValidationError in Snippets tutorial

2018-05-07 Thread Xavier Ordoquy
’: 1, ‘code’: ‘foo’ } ser = SnippetSerializer(data=snippet, many=False) ser.is_valid(raise_exception=True) Regards, Xavier Ordoquy, Linovia. > Le 7 mai 2018 à 12:36, Rainer Hihn a écrit : > > I checked out the Snippets tutorial and set it up working. Then I tried do a > simpl

Re: Optional trailing slashes in Routers

2018-04-13 Thread Xavier Ordoquy
The solution proposed on SO looks sensible to me. I think the optional trailing slash is a bad idea because you won’t have a unique identifier for representation any longer. Regards, Xavier Ordoquy, Linovia; > Le 13 avr. 2018 à 11:39, German Prostakov a écrit : > > Is it possi

Re: Any good practice to caching ListAPIView?

2018-03-21 Thread Xavier Ordoquy
Hi, The message says that you are trying to pickle the response - which is done through the cache.set(key, res,60) call - while the response is not rendered yet. This should be fixed by accessing response.content before calling the cache.set Regards, Xavier Ordoquy, Linovia. Le mardi 20 mars

Re: DateTimeField serializer different values specifying 'DATETIME_FORMAT': "%Y-%m-%dT%H:%M:%S%z",

2018-03-14 Thread Xavier Ordoquy
Hi, > Le 14 mars 2018 à 14:53, Daviddd a écrit : > > Hello All, > > I'm using Django 2.0.1 and DRF djangorestframework==3.7.7 with USE_TZ = True. > > The model field is declared as > > modified = models.DateTimeField(auto_now=True) > > > Serializer > > ** > class Meta: > fields = (

Re: query param detail route django rest returns 500

2018-02-16 Thread Xavier Ordoquy
It looks like you are using `query_param` to filter your dataset. The detail_route is based on the filtered dataset. However, there’s no reason the get_object returns more than one item. Maybe the project overrides the get_object in a way that breaks. Regards, Xavier Ordoquy, Linovia. > Le

Re: getting 401 for invalid token not 403

2018-02-07 Thread Xavier Ordoquy
Hi, The documentation also says that it will use the first scheme to figure out whether it should respond a 401 or 403 and SessionAuthentication will return a 403 upon unauthenticated unauthorized request. I provided the links in a similar SO response. Regards, Xavier, Linovia. > Le 7 févr. 2

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, > Xavie

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 fram

Re: How to build an API where the endpoints don't quite match the underlying database schemata?

2018-01-22 Thread Xavier Ordoquy
Hi, > Le 23 janv. 2018 à 00:57, JI Ioannidis a écrit : > > The tutorial, and pretty much everything else I have found, assumes that the > models defined in models.py map one-to-one to database tables. I need to > build an API for a service that uses the database, of course, but the > endpoint

Re: RequestsClient headers AttributeError

2018-01-22 Thread Xavier Ordoquy
f > not, would it make sense to add this caveat in the doc? > > On Monday, January 22, 2018 at 4:53:38 PM UTC-5, Xavier Ordoquy wrote: > No, you are not. See > https://github.com/django/django/blob/master/django/test/testcases.py#L221 > <https://github.com/django/django/blob

Re: RequestsClient headers AttributeError

2018-01-22 Thread Xavier Ordoquy
ostman, curl, etc.. > But when I use this code and > > python manage.py test > > I get the above AttributeError on the headers of my RequestsClient object. If > I don't include the faulty line, I get the expected HTTP 401 Unauthorized as > I am not sending the JWT t

Re: RequestsClient headers AttributeError

2018-01-22 Thread Xavier Ordoquy
Hi, Your code sample works fine on my installation. Ensure you do use the DRF’s RequestsClient and not Django’s. Regards, Xavier, Linovia. > Le 22 janv. 2018 à 22:29, Leo T a écrit : > > The following code produces the following error. Have I missed something? I > followed the attached doc. >

Re: Why was auth re-invented? What was missing in django?

2018-01-19 Thread Xavier Ordoquy
Le vendredi 19 janvier 2018 09:44:52 UTC+1, Thomas Güttler a écrit : > > Why was auth re-invented in Django-Rest-Framework? > What was missing in django? > I don't know the initial reasons but from my experience, Django has a couple of non obvious implicit constraints on the authentication / p

Re: Can I use DRF 2.4.x with Django 1.11?

2018-01-15 Thread Xavier Ordoquy
Hi, It’s unlikely that 2.4 supports Django 1.11 out of the box. Either you’ll have to upgrade to a more recent Django REST framework or you’ll have to port DRF 2.4.x Regards, Xavier. > Le 15 janv. 2018 à 17:23, wolfg a écrit : > > Hi, I have a project using Django 1.6.x and DRF 2.4.3. Can I

Re: DRF Tutorial Object Level Permissions

2018-01-09 Thread Xavier Ordoquy
Hi You should rename « permissions_classes » into « permission_classes » (note it is one letter shorter). Regads, Xavier, Linovia. > Le 10 janv. 2018 à 07:48, Craig Wilson a écrit : > > I'm working through the DRF tutorial and everything has been working fine up > until topic Object Level P

Re: Error in documentation?

2018-01-01 Thread Xavier Ordoquy
Hi, Indeed, nice catch. This was fixed in https://github.com/encode/django-rest-framework/pull/5713 but hasn’t been deployed yet (will be for the next release). Regards, Xavier. > Le 1 janv. 2018 à 22:36, Victor M. Mendiola Lau a écrit : > > Hello everybody. > > I'm new to the Django and Dja

Re: Django Version 2.0 DRF Support Timeline

2017-12-09 Thread Xavier Ordoquy
e back to Django 2.0 and try and solve those issues > then. The DRF Docs say Django 2.0 is still in alpha. > > Joe > > On Saturday, December 9, 2017 at 1:55:40 PM UTC-8, Xavier Ordoquy wrote: > Hi joe, > > Latest DRF version should already be compatible. > There ma

Re: Django Version 2.0 DRF Support Timeline

2017-12-09 Thread Xavier Ordoquy
Hi joe, Latest DRF version should already be compatible. There may be some regressions here and there that tests didn’t catch, but so are some bugs with 1.11 too. Regards, Xavier. > Le 9 déc. 2017 à 22:53, Joe C a écrit : > > Hey, > > I'm just setting up a new Django project and I ran into i

Re: method GET not allowed

2017-12-05 Thread Xavier Ordoquy
Hi, This url: > url(r'^dashboards', views.DashboardViewCreate.as_view()), catches all over the others because it doesn’t contains a termination clause. Regards, Xavier. > Le 5 déc. 2017 à 20:15, Angel Omar Rojas Pacheco a > écrit : > > hi everyone > > I have a problem with allow method

Re: REST framework Official Tutorial 6 bug

2017-11-16 Thread Xavier Ordoquy
Hi, The tutorial has no mention of renderer_class but has renderer_classes (note the extra ES at the end). Regards, Xavier. > Le 16 nov. 2017 à 14:17, YUN TANG a écrit : > > I've been following the official tutorial until 6-viewsets-and-routers/ >

Re: Why does ModelSerializer have no way to delete the instance?

2017-09-14 Thread Xavier Ordoquy
message. Regards, Xavier Ordoquy, Linovia. > Le 14 sept. 2017 à 08:00, Vignesh a écrit : > > I noticed that list, retrieve and update all go through the serializer to > perform the actions but destroy does not. My guess is because in these cases > a response of the object(s) is r

Re: Serializer Field Meta validators

2017-09-11 Thread Xavier Ordoquy
Hi, DRF fields adds the validators during the init rather than setting them on Meta. That help with heritage. You can see how this works at https://github.com/encode/django-rest-framework/blob/master/rest_framework/fields.py#L799-L802 Hope this helps, Regards, Xavier Ordoquy, Linovia. > Le

Re: Regular serializer in browsable api

2017-08-28 Thread Xavier Ordoquy
you to get something working. Regards, Xavier Ordoquy, Linovia. > Le 27 août 2017 à 17:54, Ivlev Denis a écrit : > > > Hi. > I have ModelSerializer with field of regular Serializer, them not showed in > browsable api. What am I doing wrong? > -- > You receive

Re: Is it possible to set permission_classes for OR relation

2017-07-20 Thread Xavier Ordoquy
Hi, You’ll need to implement an intermediate permission classe that would perform the OR and delegate the permission check to the subclasses. Regards, Xavier Ordoquy, Linovia. > Le 19 juil. 2017 à 19:29, William Huang a écrit : > > Hi All, > > Is it possible to set permission

Re: rest_framework.authtoken is missing in version 3.6.3

2017-06-27 Thread Xavier Ordoquy
Hi, As far as I can tell, it is available and running well. What makes you think it doesn’t ? Regards, Xavier Ordoquy, Linovia. > Le 27 juin 2017 à 19:28, Roberto Santos a écrit : > > Dear all > > I've just upgraded from version 3.6.2 to 3.6.3 and realised that authtoken

Re: Stop creating Duplicate values on post request

2017-06-27 Thread Xavier Ordoquy
Hi, You didn't provide the HumanSerializer so there's little we can do. Regards, Xavier Ordoquy, 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 fr

Re: Custom field implementation of BooleanField not efective when serialized object is retrieved

2017-06-20 Thread Xavier Ordoquy
Hi, We can’t provide any meaningful answer here as you don’t provide any hint about how you wrote the serializer. Regards, Xavier Ordoquy, Linovia. > Le 20 juin 2017 à 08:25, Priyanka Thakur a écrit : > > Hi, > > I have defined a custom field instead of BooleanFiel

Re: Error in tutorial (calling serializer.data)?

2017-06-19 Thread Xavier Ordoquy
() serializer.validated_data serializer.save() But in the latter case, you can’t call serializer.data (doesn’t make sense either as you provided the data in the first place). Hopes this helps, Xavier Ordoquy, Linovia. > Le 19 juin 2017 à 16:05, mrlemon a écrit : > > Hi - just come to DRF; exploring for an

Re: get_identity method of BaseSerializer removed in DRF 3.x version. But no documentation

2017-06-14 Thread Xavier Ordoquy
Hi, mapping between data and instances is performed when instantiating the serializer. Depending on your use case, it'll be get_object and/or your own code that would substitute to it. Regards, Xavier Ordoquy, Linovia. Le mercredi 14 juin 2017 18:44:09 UTC+2, Priyanka Thakur a écrit : &

Re: pre_save and post_save replacement methods in DRF 3.6.2

2017-06-13 Thread Xavier Ordoquy
Hi, it means you can perform the pre save before calling super’s perform_create/update and then call the post_save from you override perform_create/update. Regards, Xavier Ordoquy, Linovia. > Le 13 juin 2017 à 11:09, Priyanka Thakur a écrit : > > Hi, > > Though i have gone

Re: PrimaryKeyRelatedField doesn't validate null value even if allow_null=True

2017-05-30 Thread Xavier Ordoquy
writing a test case to demonstrate the issue. Regards, Xavier Ordoquy, Linovia. > Le 30 mai 2017 à 13:33, Priyanka Thakur a écrit : > > Hi Xavier, > > Sorry, I misunderstood the earlier statement "JSON payload.". > > Actually, you are right , the data which is f

Re: PrimaryKeyRelatedField doesn't validate null value even if allow_null=True

2017-05-30 Thread Xavier Ordoquy
I highly suspect you’re sending JSON payload with a Form like content type. JSON’s null is not a unicode. Regards, Xavier Ordoquy, Linovia. > Le 30 mai 2017 à 10:31, Priyanka Thakur a écrit : > > The request is a PUT request , in a test case and the response from the > seria

Re: PrimaryKeyRelatedField doesn't validate null value even if allow_null=True

2017-05-30 Thread Xavier Ordoquy
actual serializer’s instance) so we can check what constraints it has ? Did you try with the latest Django REST framework version ? Regards, Xavier Ordoquy, Linovia. -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsu

Re: [GitHub Process]: New Project for API Docs?

2017-05-19 Thread Xavier Ordoquy
> Le 19 mai 2017 à 10:42, Carlton Gibson a écrit : > > Hiya, > > I'm trying to get a grip on the tickets relating to the generated API > documentation. My issue is GitHub's tracker doesn't offer great ways of > filtering to just the relevant tickets. Thanks for dealing with it :) > In the

Re: Django rest framework - nested serializer - retrieve valid records of nested serializer and error for invalid

2017-05-14 Thread Xavier Ordoquy
Hi, You will need to loop on the items and use a serializer on each of them. Regards, Xavier Ordoquy, Linovia. > Le 14 mai 2017 à 07:19, Gaurav Pant a écrit : > > > 0 > down vote > <>favorite > > <http://stackoverflow.com/questions/43960378/django-rest-fra

Re: Factory pattern for serializers

2017-05-02 Thread Xavier Ordoquy
Hello, It doesn’t really make sense to create a factory here. Django forms requires some overhead to handle the form management part whereas DRF’s serializers don’t need that. You should be able to write your own factory using Python’s type(name, bases, dict). Regards, Xavier Ordoquy, Linovia

Re: How do you implement custom response?

2017-04-17 Thread Xavier Ordoquy
this helps, Xavier Ordoquy, Linovia. > Le 17 avr. 2017 à 09:52, Yanze Dai a écrit : > > I found that the DRF's return value could be various upon different > occasions. So I want to make sure all my JSON return have "code" "message" or > other values neste

Re: serializer.is_valid() throws error - "to_internal_value() must be implemented"

2017-04-14 Thread Xavier Ordoquy
Hi, Why did you use BaseSerializers ? Regards, Xavier Ordoquy, Linovia. > Le 14 avr. 2017 à 23:44, Suprita Shankar a écrit : > > Context: I am having problem accessing fields which are validated by nested > serializers. > I have a very sample model as shown below. > For

Re: ApiClient and AcceptHeaderVersioning

2017-04-05 Thread Xavier Ordoquy
Hi, Unfortunately at the moment, you’ll have to perform the call to json.dumps, drop the format and use content-type to set the version. Regards, Xavier Ordoquy, Linovia. > Le 5 avr. 2017 à 11:09, Tobias Zanke a écrit : > > I am using the AcceptHeaderVersioning and like to write s

Re: Possible bug: date is not translated by serializer

2017-04-02 Thread Xavier Ordoquy
> Is there anything conceptually wrong with an API providing a translated date > according to request language ? Which ones of PT, MT, CT or ET are you going to choose for en-US ? > Marek Regards, Xavier Ordoquy, Linovia. -- You received this message because you are subscribed to the Google Gr

Re: Writing to Nested ModelSerializer

2017-03-31 Thread Xavier Ordoquy
of us have boxed thoughts and it’s hard sometime to think out of the box. ModelSerializer is nice to get started and may go quite far. However, while processing the various project requirements we get caught in moving forward with a ModelSerializer where it doesn’t make sense. We bend it and try to mak

Re: Possible bug: date is not translated by serializer

2017-03-31 Thread Xavier Ordoquy
time. My bet here, you don’t provide TZ information so your JS client may not perform the correct translation. Regards, Xavier Ordoquy, Linovia. > Le 31 mars 2017 à 19:30, marek.onus...@gmail.com a écrit : > > Hi, > > I'm learning Django Rest Framework but otherwise I

Re: UniqueTogetherValidator model serializer or model viewset logic for custom "lat-long" django model field with pre-save method

2017-03-23 Thread Xavier Ordoquy
ield but couldn't get it to make the lat_long value > without knowing the serializer object a priori > * SerializerMethodField with get_lat_long(obj) method didn't work either If you have a unique constraint on those fields, serializer will blow because it enforces the check before sa

Re: UniqueTogetherValidator model serializer or model viewset logic for custom "lat-long" django model field with pre-save method

2017-03-23 Thread Xavier Ordoquy
django user mailing list first. Regards, Xavier Ordoquy, Linovia. > Le 23 mars 2017 à 23:47, Mark Mikofski a écrit : > > Hi, I have a Django (1.8.5) model with a custom field that calls pre-save() > to evaluate the field from other model fields: > > class LatLongFiel

Re: Is it possible get JSON-Schema from API fitting for jsonschema2pojo.org?

2017-03-21 Thread Xavier Ordoquy
Hi, You’ll likely want to alter the way metadata are rendered: http://www.django-rest-framework.org/api-guide/metadata/#custom-metadata-classes <http://www.django-rest-framework.org/api-guide/metadata/#custom-metadata-classes> Regards, Xavier Ordoquy, Linovia. > Le 21 mars 201

Re: Why is 'write_only_fields' not used?

2017-03-16 Thread Xavier Ordoquy
ill be removed". Regards, Xavier Ordoquy, Linovia. > Le 17 mars 2017 à 07:43, CocaCola a écrit : > > Will read_only_fields also disappear? soon? > > > Any reason? > > class SomeSerializer(serializer.ModelSerializer): > class Meta: > model = SomeM

Re: Why is 'write_only_fields' not used?

2017-03-16 Thread Xavier Ordoquy
Hi, We didn’t remove the read_only_fields as it’s pretty common. However, I would be willing to remove the read_only_fields since the extra_kwargs is already there. Regards, Xavier Ordoquy, Linovia. > Le 17 mars 2017 à 07:01, CocaCola a écrit : > > in documents.. > > The wr

Re: Problem interacting with API using the generated documentation

2017-03-16 Thread Xavier Ordoquy
Hi, Logs from the server would really be helpful here. What does it says ? 500 ? 400 ? If 500, what’s the traceback ? Regards, Xavier Ordoquy, Linovia. > Le 16 mars 2017 à 16:51, Antoine Nguyen a écrit : > > Hi, > > I'm making some tests with the built-in documentation (

Re: DRF Pagination with custom ViewSet

2017-03-15 Thread Xavier Ordoquy
Hi Angus, The first thing would be to fire django debug toolbar and investigate whether the pagination is passed to the context. If it isn’t there’s something in your code that prevents it. If it is, you’ll have to go through the templates to figure. Regards, Xavier Ordoquy, Linovia. -- You

Re: Why is it showing a hashed password?

2017-03-15 Thread Xavier Ordoquy
designed. It’s HARD and time consuming. It requires knowledge and deep understanding of the requirements. Regards, Xavier Ordoquy, Linovia. -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and st

Re: import error in tutorial quickstart

2017-03-12 Thread Xavier Ordoquy
Hi madame, You have missed the trailing dot in this part in the tutorial: django-admin.py startproject tutorial . # Note the trailing '.' character Regards, Xavier Ordoquy, Linovia. > Le 13 mars 2017 à 07:06, Tony Wang a écrit : > > Hi Guys > > Have you guys test

Re: Issue with Built in API Docs

2017-03-10 Thread Xavier Ordoquy
Provided we have a couple of issue ongoing or already fixed on the current issue, I’d expect another release to be out soon, but I have no idea how soon. Meanwhile, installing from master should do. We’ll be focusing on bug fixing in the short term. Regards, Xavier Ordoquy, Linovia. > Le

Re: Issue with Built in API Docs

2017-03-10 Thread Xavier Ordoquy
Hi, Thanks for raising this. This has been reported and fixed (https://github.com/tomchristie/django-rest-framework/issues/4952 <https://github.com/tomchristie/django-rest-framework/issues/4952>). Regards, Xavier Ordoquy, Linovia. > Le 10 mars 2017 à 13:11, Abu Ashraf Masnun a écrit

Re: Tutorial 1 - JSONResponse

2017-02-20 Thread Xavier Ordoquy
Hi, You just made a good point ;) The tutorial was written way before JSONResponse was introduced in Django. I just checked this was introduced in Django 1.7. Since DRF now supports 1.8+ we could use Django’s JSONResponse indeed. Regards, Xavier Ordoquy, Linovia. > Le 20 févr. 2017 à 09

Re: version 3.5.4 of drf and Python 3.4 support

2017-02-17 Thread Xavier Ordoquy
ity> Regards, Xavier Ordoquy; Linovia. > Le 17 févr. 2017 à 12:57, vidja.hun...@gmail.com a écrit : > > Thanks, > > taken from the django docs: > https://docs.djangoproject.com/en/1.10/faq/install/ > The upcoming Django 1.11 will support python 3.4, so is dropping 3.4

Re: version 3.5.4 of drf and Python 3.4 support

2017-02-17 Thread Xavier Ordoquy
Hi, We support the Python versions that the supported Django version supports. If DRF droped 3.4 it means Django also dropped it. We can’t guarantee it will work or will not work. This is up to you to ensure you don’t have issues. Regards, Xavier Ordoquy, Linovia. > Le 17 févr. 2017 à 11

Re: Pagination and Filtering

2017-02-02 Thread Xavier Ordoquy
This looks more like you’ve set a list for pagination class for that view. What does your view looks like ? Regards, Xavier Ordoquy, Linovia. > Le 2 févr. 2017 à 16:09, Thiago Mambretti a écrit : > > Sorry, > > The error I'm getting is the following: > > > Env

Re: Pagination and Filtering

2017-02-02 Thread Xavier Ordoquy
Hi, I can’t think of a reason why they wouldn’t work in particular if the documentation doesn’t says otherwise. Any specific issue that makes you think they don’t ? Regards, Xavier Ordoquy, Linovia. > Le 2 févr. 2017 à 16:07, Thiago Mambretti <mailto:wdthi...@gmail.com>> a écr

Re: slow query viewset query

2017-01-11 Thread Xavier Ordoquy
ation 57[microseconds], so this is what we expect. Also our previous > API which is ASP.NET + MSSQL is about 600[ms] roundtrip. > > Thanks again! > > On Wednesday, January 11, 2017 at 1:00:56 AM UTC-8, Xavier Ordoquy wrote: > Hi, > > It’s likely either the displayed filter or th

Re: URL wih dot in Django Rest Framework

2017-01-11 Thread Xavier Ordoquy
This is similar to issue #4341 Regards, Xavier Ordoquy, Linovia. > Le 11 janv. 2017 à 00:58, Bernardo Garcia a écrit : > > I have the following model with a primary_key=True specified: > > class Team(models.Model): > name = models.CharField( > max_length=64,

Re: slow query viewset query

2017-01-11 Thread Xavier Ordoquy
Hi, It’s likely either the displayed filter or the create/update form from the browsable API that spans some relation and gets the UI slow. Try to perform the same request as JSON that should validate the previous assomption. Regards, Xavier Ordoquy, Linovia. > Le 11 janv. 2017 à 09:20, M

Re: Include drf-based package to section "documenting your api"

2016-12-28 Thread Xavier Ordoquy
s.com > <mailto:django-rest-framework+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. Sure, you need to make a PR for that. It should be explained in the 3rd party section of the document

Re: combine two queryset to one Serializers

2016-12-21 Thread Xavier Ordoquy
ld() > > > post = Post.objects.all() > post_set = PostSet.objects.all() > > How I can comebine two queryset( as above post, post_set ) from two different > model combine to one ShowSerialzer? > It’s as simple as adding query sets together: full_data = list(post) + list

Re: Serializer and Django Model

2016-12-21 Thread Xavier Ordoquy
erstand better What would that change the understanding ? Regards, Xavier Ordoquy, 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 emai

Re: Custom Related Field proper usage?

2016-12-13 Thread Xavier Ordoquy
> Le 13 déc. 2016 à 20:58, Lev Avakian a écrit : > > I have a a UserProfile model that has a OneToOne with a the > django.contrib.auth User and looks something like this: > > class UserProfile(BaseModel): > # Authentication information > email = models.OneToOneField( > User, to

Re: ModelSerializer doesn't hit update method

2016-11-29 Thread Xavier Ordoquy
Hi > Le 30 nov. 2016 à 05:04, Ashutosh Das a écrit : > > Here is my model: > > class Movie(models.Model): > name = models.CharField(max_length=800, unique=True) > imdb_rating = models.IntegerField(null=True) > movie_choice = ( > ('Act', 'Action'), > ... > )

Re: I need to Filter from multiple tables return a json response

2016-11-22 Thread Xavier Ordoquy
Hi, > Le 23 nov. 2016 à 07:04, pradam.programm...@gmail.com a écrit : > > I need to Filter from multiple tables and return response like this [ {'first > name':'Max',','last name':'Yuri','age':23,'gender':'Male'},{'first > name':'Alex',','last name':'John','age':23,'gender':'Male'}] > in rest f

Re: Nesting DRF ViewSets

2016-11-17 Thread Xavier Ordoquy
Hi, > Le 17 nov. 2016 à 09:10, Ryan Sears > a écrit : > > Hi folks! > > I've got a question on nesting viewsets properly to have different permission > classes/contexts. Any extra eyes would be greatly appreciated, as it's been > open for about a week and I'm not con

Re: Pagination In APIView.

2016-11-14 Thread Xavier Ordoquy
The pagination is explained at http://www.django-rest-framework.org/api-guide/pagination/#pagenumberpagination and the configuration on a per view basis is in the second part of http://www.django-rest-framework.org/api-guide/pagination/#setting-the-pagination-style Regards, Xavier Ordoquy

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

Re: Browsable API and Versioning

2016-11-03 Thread Xavier Ordoquy
Hi Robyn, > Le 3 nov. 2016 à 21:22, Robyn Smith a écrit : > > Hello Everyone! > > DRF is amazing. Just a quick thank you to the community! > > I'm working on a project where we're building an API from scratch using the > Django REST Framework, and when working on the Proof of Concept, we star

Re: getting interface error after changing the DB connection details

2016-10-26 Thread Xavier Ordoquy
Hi, > Le 26 oct. 2016 à 14:28, Raghunath Raghava a écrit : > > Hi All, > > I am having the following " interface error : not connected" to the DB while > connecting to the DB through DRF. > > whereas I have written a separate test class for connection to the DB it > works fine , but when I

Re: Model serializer factory

2016-10-24 Thread Xavier Ordoquy
Hi, > Le 24 oct. 2016 à 14:27, Горобец Дмитрий a écrit : > > Hello, > > Is there a shortcut for making dynamic model serializers like > modelform_factory? No, there’s no such thing for now. However, as you can see from the model form_factory sources, it shouldn’t be too hard to do something

Re: Django REST framework 3.4.7 not support RequestsClient

2016-10-21 Thread Xavier Ordoquy
Hi, It seems that the DRF documentation was updated ahead the 3.5 release. If it still doesn’t work, please upgrade to the 3.5 release. > Le 21 oct. 2016 à 11:19, korea k a écrit : > > oh,I guess so. > thanks a million for your answering. > smile~ > > 在 2016年10月20日星期四 UTC+8下午4:10:26,Tom Chris

Re: Django REST framework 3.4.7 not support RequestsClient

2016-10-19 Thread Xavier Ordoquy
Hi, > Le 19 oct. 2016 à 10:31, korea k a écrit : > > hi,guys. I read the offical docs through > http://www.django-rest-framework.org/api-guide/testing/ > It say as blew: > > REST framework also includes a client for interacting with your application > using the popular Python library, requ

Re: Hyperlinking to a filtered list

2016-10-17 Thread Xavier Ordoquy
Hi, > Le 17 oct. 2016 à 23:23, Brian Stempin a écrit : > > Hi, > I'm trying to hyperlink to a filtered list. Let's say I have these > resources: User and Transaction. A User has many Transactions, and each > Transaction has exactly one User. Because a User could have hundreds of > transac

Re: Serializer context with viewsets

2016-10-03 Thread Xavier Ordoquy
Yes, that's correct. Xavier, Linovia. Le lundi 3 octobre 2016 11:31:17 UTC+2, AJ Ostergaard a écrit : > > Ah - so the way to provide additional detail for the serializer is to > override get_serializer_context() in the ViewSet and have it return the > default context plus the additional custom

Re: Tutorial workflow or approach

2016-09-21 Thread Xavier Ordoquy
Hi Mehmet, > Le 20 sept. 2016 à 22:04, Mehmet Dogan a écrit : > > Hello all, > > I am trying to get my feet wet with the DRF and felt the urge to provide a > piece of feedback. I found the quickstart pretty helpful, but the 7-step > tutorial threw me off. Although I appreciated it more at my

Re: Not picking up Danish translations

2016-08-31 Thread Xavier Ordoquy
Hi, > Le 31 août 2016 à 11:01, Jeppe Vesterbæk a écrit : > > I'm sending requests with "Accept-Language: da". Translations originating > from Django (eg. "This field is required.") and translations in my own apps > work. Strings in rest framework always are always returned in english, eg. > "

Re: PUT request and updating ManyToMany

2016-08-13 Thread Xavier Ordoquy
> Le 13 août 2016 à 14:20, Jenna Pullen a écrit : > > One further question regarding your response. If a PUT request should clear > out the existing categories if a single category is posted. How would the > user keep his existing catergories if he just wanted to add another category > to the

Re: ManyToMany validation issue.

2016-08-13 Thread Xavier Ordoquy
Nested serializers don't work with html forms at the moment. Started to work on this is this is still work in progress. 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

Re: PUT request and updating ManyToMany

2016-08-13 Thread Xavier Ordoquy
Hi, First thing you should note, it’s not just about ManyToMany relation here but rather about nested serializers. > Le 13 août 2016 à 12:16, Jenna Pullen a écrit : > > I have a couple of questions below and would really appreciate some light on > the way to handle the situations described b

  1   2   >