filter from databse list

2013-10-29 Thread Mahantesh U
Hi, I'm using chcekboxes for 3 location india,china,usa in my form. The selected filed are stoiring in database in list like: location: ['india','china', 'usa'] 1st row in databse: ['india'] 2nd row in databse: ['india', 'china'] 3rd row in databse: ['india', 'china', 'usa'] in my vie

Re: setting csrftoken to httponly and building ajax forms: not going to happen?

2013-10-29 Thread Tom Evans
On Sat, Oct 26, 2013 at 11:18 PM, Spork Spork wrote: > Hi, > > I'm using Django 1.4.1b, and for security purposes would like to make the > csrftoken cookie httponly, and therefore inaccessible from Javascript. Since > this support is not available in my version of Django, I planned to follow > thi

django-allauth: Multiple signup forms

2013-10-29 Thread Franco Alarcon
Greetings everyone, I know that maybe this is not the best place to ask, but I already asked in the django-alluth forum without luck, so here I'm. I'm developing an application in which exists two kind of user and I have to show a different singup form for each one. The first thing that I th

Keyword arguments passed to ListView.as_view() in urlconf ignored, django 1.5.4

2013-10-29 Thread Chang Sun
code segment 1: url(r'^some_url$', SomeTemplateView.as_view(), {'tab': 'index'}), the 'tab' variable can be fetched in the template while in code segment 2: url(r'^some_url$', SomeListView.as_view(), {'tab': 'index'}), the 'tab' variable is missing in the template. I found that in Lib\site-p

Re: Keyword arguments passed to ListView.as_view() in urlconf ignored, django 1.5.4

2013-10-29 Thread tim
I don't think so. There is actually a ticket to discontinue this behavior on the CBVs that do it: https://code.djangoproject.com/ticket/19878 On Tuesday, October 29, 2013 9:51:06 AM UTC-4, Chang Sun wrote: > > code segment 1: > > url(r'^some_url$', SomeTemplateView.as_view(), {'tab': 'index'}), >

Django Transactions Performance increase

2013-10-29 Thread Robin Fordham
Hi, I have been doing some reading and am looking to increase the performance of updating existing database entries via incoming datafeeds. I am finding conflicting opinions if wrapping updates in a transaction context manager helps improve performance, some sources say it does, others say it

Re: Django Transactions Performance increase

2013-10-29 Thread Tom Evans
On Tue, Oct 29, 2013 at 2:39 PM, Robin Fordham wrote: > Hi, > > I have been doing some reading and am looking to increase the performance of > updating existing database entries via incoming datafeeds. > > I am finding conflicting opinions if wrapping updates in a transaction > context manager hel

Re: Digging up Django class-based views - 1

2013-10-29 Thread Tom Evans
On Mon, Oct 28, 2013 at 8:01 AM, Leonardo Giordani wrote: > Hi all, > > I want to share with you a post about class-based views. > Hope you find it useful. > > http://lgiordani.github.io/blog/2013/10/28/digging-up-django-class-based-views-1/ > Nice - clearly written. You have a couple of typos in

Re: Digging up Django class-based views - 1

2013-10-29 Thread Leonardo Giordani
Thank you! I am going to correct it asap. Leonardo Giordani Author of The Digital Cat My profile on About.me - My GitHub page- My Coderwall profile 2013/10/29 Tom Eva

Re: Django Transactions Performance increase

2013-10-29 Thread Robin Fordham
Thanks Tom, that clears things up a lot and gives me something to work on. Sorry for the noob question; If you cannot update the database without first creating the model > instance - perhaps you need to call a method on the model instance in > order to get one of the values to update, for exampl

Re: Django ManyToMany performance?

2013-10-29 Thread Tom Evans
On Mon, Oct 28, 2013 at 8:23 PM, Ruturaj Dhekane wrote: > Thanks Daniel and Robin. > > Have we seen the scales where Many-to-many DBs through Django work well? > Like 50K articles in 5K publications. Numbers are really meaningless. One of our legacy products has a database with 300 million rows i

Re: Django Transactions Performance increase

2013-10-29 Thread Apostolos Bessas
Hi Robin, As far as I can tell, using one transaction should increase the performance of the process. The reason is that you issue just one COMMIT for the whole process instead of one per UPDATE. As an added benefit, it helps with the data integrity. There are two main ways I know you can improve

Re: Django Transactions Performance increase

2013-10-29 Thread Tom Evans
On Tue, Oct 29, 2013 at 4:29 PM, Robin Fordham wrote: > What do you mean by this? > > By the nature of the data coming in it is pre validated, so I know already > that row[0] is a valid id, row[1] is a valid foo value, row[2] is a valid > baa value. > In case you were simplifying the example for

Re: Digging up Django class-based views - 1

2013-10-29 Thread pywebdesign
thank you so much! this is amazing and respond exactly to what I was trying to understand! On Monday, 28 October 2013 04:01:47 UTC-4, Leo wrote: > > Hi all, > > I want to share with you a post about class-based views. > Hope you find it useful. > > > http://lgiordani.github.io/blog/2013/10/28/dig

Re: django difference between - one to one, many to one and many to many

2013-10-29 Thread Aamu Padi
Thank you so much! I will look into that! :) On Tuesday, October 29, 2013 1:37:37 AM UTC+5:30, C. Kirby wrote: > > Those concepts are actually RDBMS (Database) ideas. You would probably be > better off reading up on those. This looks to be a pretty good explanation: > > http://net.tutsplus.com/tu

Re: django difference between - one to one, many to one and many to many

2013-10-29 Thread Sandeep kaur
On Tue, Oct 29, 2013 at 12:36 AM, Aamu Padi wrote: > > So, this is my first time learning computer language. And I chose python and django. Now, I got many of the basic concepts of python and also django. I can create new page with the views and all other stuff. But I am still confused with the re

RestFul with Class Based Views best practice

2013-10-29 Thread pywebdesign
Hi, I am trying to find/develop a best way to name and organize Views class to be consistent and flexible. I am working on a project witch involve an model called Song. It's kind of a midi song in a database with attibutes about authors, name ... to make it simple. Now I want web pages that p

Re: RestFul with Class Based Views best practice

2013-10-29 Thread Marc Aymerich
On Tue, Oct 29, 2013 at 8:45 PM, pywebdesign wrote: > Hi, > > I am trying to find/develop a best way to name and organize Views class to > be consistent and flexible. > > I am working on a project witch involve an model called Song. It's kind of > a midi song in a database with attibutes about au

Re: RestFul with Class Based Views best practice

2013-10-29 Thread Xavier Ordoquy
Hi, You probably want to have a look at django rest framework. You use can will be easy with it, in particular if you use http://django-rest-framework.org/api-guide/viewsets.html#modelviewset Regards, Xavier. Le 29 oct. 2013 à 20:45, pywebdesign a écrit : > Hi, > > I am trying to find/develo

multiple databases and syncdb problem

2013-10-29 Thread Sells, Fred
I can syncdb OK if I don't add allow_syncdb to my router, but if I add the allow_syncdb to the router, only my default db is synced. Any idea what I'm doing wrong, code is: def allow_syncdb(self, db, model): print 'allow syncdb for* Inserv Router', db, model._meta.a

Re: multiple databases and syncdb problem

2013-10-29 Thread Simon Charette
syncdb defaults to syncing the 'default' database when no --database is specified . Try specifying which database to synchronize, with the --database=inserv flag in your case. Le mardi 29 octobre 2013 16:52:

Re: RestFul with Class Based Views best practice

2013-10-29 Thread pywebdesign
Ok, thank you! I was not doing it correctly at all. http://django-rest-framework.org is amazing. I am now using Marc's design and trying to event use CreateView and other generic view -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubsc

Re: django-stdimage NoneType problem

2013-10-29 Thread Russell Keith-Magee
Hi Oscar, The error you describe is the sort of thing that happens when a comma goes missing, particularly in a list of tuples, but it's possible in other circumstances, too. Take the following code as an example: x = [ None (4, 5, 6) ] On first inspection, this looks fine -- a list that co

Re: django.utils.copycompat is deprecated

2013-10-29 Thread Russell Keith-Magee
Hi Tino On Tue, Oct 29, 2013 at 12:49 AM, tino wrote: > Hello, > > I am getting the following in apache error log. > > > [error] > /home/findme/virtualenv/lib/python2.7/site-packages/django/utils/copycompat.py:10: > DeprecationWarning: django.utils.copycompat is deprecated; use the native > copy

Re: django-stdimage NoneType problem

2013-10-29 Thread Oscar Carballal
Thanks Russell, I actually see a comma after the None... I'm not sure what you're referring to. Well, it's an opensource project, so here you go :) https://github.com/cidadania/e-cidadania The affected code is located here (both fields.py and models.py) https://github.com/cidadania/e-cidadania/tr

Re: django-stdimage NoneType problem

2013-10-29 Thread Oscar Carballal
Oops, sorry Russell, the affected code is here (branch mistake): https://github.com/cidadania/e-cidadania/blob/python3/src/core/spaces/models.py 2013/10/30 Oscar Carballal > Thanks Russell, I actually see a comma after the None... I'm not sure what > you're referring to. > > Well, it's an opens

Re: Keyword arguments passed to ListView.as_view() in urlconf ignored, django 1.5.4

2013-10-29 Thread Chang Sun
Thank you for your reply, Tim. This behavior confuses new users of CBVs. It takes time to learn it. On Tue, Oct 29, 2013 at 10:30 PM, tim wrote: > I don't think so. There is actually a ticket to discontinue this behavior > on the CBVs that do it: https://code.djangoproject.com/ticket/19878 > >