Re: django - class based view store post data

2015-05-31 Thread Shekar Tippur
> > James, > Thanks for the response. I followed your instructions and took out the overriding of post and get methods. However, as I am testing the app using curl, I ended up with CSRF verification failed. Request aborted. - Shekar -- You received this message because you are subscribed to

Django ORM Interaction between order_by(), distinct(), and filter()

2015-05-31 Thread Suriya Subramanian
I have a question about how order_by(), distinct(), and filter() interact. This question is applicable only to the PostgreSQL backend since the Queryset is constructed by passing filed arguments to distinct(). https://docs.djangoproject.com/en/1.8/ref/models/querysets/#distinct In the other ba

Problem in updating database models.

2015-05-31 Thread akshat
I am using Django 1.8 to build a demo project.Inside my project I have one app 'Book'.Book app initially had this model - class Book(models.Model): title = models.CharField(max_length=200) author = models.TextField() pub_date = models.DateTimeField('date published') I applied

python type class and object class

2015-05-31 Thread Eddilbert Macharia
Hello All, I know this is not python group but i believe you guys can help, especially because Django makes heavy use of metaclases. I'm having headache trying to understand the cyclic relationship that exit between the `metaclass` type, the `object` class, and the `class` type. I'm trying to

Re: django - class based view store post data

2015-05-31 Thread James Schneider
I would remove the code entirely for the post() and get(). As it stands, your create() method is never being called via post() since it is normally called by CreateAPIView. From a brief look at the DRF source, the reason you are getting the error that you are is because you are calling self.get_obj

Re: icontains case-sensitive on MySQL

2015-05-31 Thread Mike Dewhirst
On 1/06/2015 5:57 AM, Jake Gordon wrote: There needs to at least be a warning in the documentation. https://docs.djangoproject.com/en/1.8/ref/databases/#collation-settings I spent a lot of time debugging only to find this was a problem with Django. On Thursday, October 16, 2008 at 6:56:07 P

Re: generating pdf report with django-easy-pdf

2015-05-31 Thread Jose Aguirre
> *You need to add the get method this:* > def get(self, request, *args, **kwargs): """ Handles GET request and returns HTTP response. """ context = self.get_context_data(**kwargs) #data: dic, array, etc. values = [1,2,3,4,5] # add the data in the context conte

Re: icontains case-sensitive on MySQL

2015-05-31 Thread Jake Gordon
There needs to at least be a warning in the documentation. I spent a lot of time debugging only to find this was a problem with Django. On Thursday, October 16, 2008 at 6:56:07 PM UTC-4, Malcolm Tredinnick wrote: > > > On Thu, 2008-10-16 at 11:15 -0700, AndyB wrote: > > Well - someone on #Djang

Re: problem with requests and django view

2015-05-31 Thread ogi
I found myself the solution. Stupid!. The variable *url* was entered without* slash* at the end. Anyway thanks to all. Maybe somebody could see that if I copied the *url* and urls.py in the question. Am Freitag, 29. Mai 2015 17:09:39 UTC+2 schrieb ogi: > > Hi > > I have problems to post some j

Re: django - class based view store post data

2015-05-31 Thread Shekar Tippur
> > James, > > Thanks for responding. I have changed the view to: class AddToUserProfile(generics.CreateAPIView): permission_classes = (permissions.IsAuthenticatedOrReadOnly,IsOwnerOrReadOnly) queryset = UserPrefs.objects.all() serializer_class = UserPrefSerializer lookup_field

Re: CSRF verification failed when I use smart phone

2015-05-31 Thread Gergely Polonkai
I had this error when I had two Django application with the same domain and both with the same (default) CSRF cookie name. Changing the cookie name to something different solved the issue. On 30 May 2015 22:30, "Michael Greer" wrote: > We have started seeing this behavior occasionally. No code ch

Re: django - class based view store post data

2015-05-31 Thread James Schneider
A few things to consider: In your view, it looks like you have 'lookup_fields' instead of 'lookup_field'. http://www.django-rest-framework.org/api-guide/generic-views/#genericapiview >From a quick read through the DRF docs, it also looks like it only requires a single str value, and you are have