Re: How to change type of field in model, when database is already populated ?

2015-05-17 Thread donarb
On Saturday, May 16, 2015 at 6:26:32 AM UTC-7, mangu rajpurohit wrote: > > Hi, > > I am new to Django. I am working on an application ,where the types of > table fields in database are not known before hand. So, say for eg. In > student table, I am assigning CharField to marks field, ie > >

Re: how to use static in development with PyCharm?

2015-05-17 Thread Lucianovici
In my case, since I had a bunch of modules inside the settings package, I had to be careful and configure the Django support for PyCharm where the actual static settings are placed, i.e. *common.py* for my setup. |-- settings | |-- __init__.py | |-- codeship.py | |-- common.py | |--

Re: Leveraging the ORM for very complex queries

2015-05-17 Thread Suriya Subramanian
Thank you Russ and Michael. For the reference of other users and to get feedback, here's what I ended up doing: https://gist.github.com/anonymous/154512b369fe7e273631 import itertools from django.db import connection """ Combine SQL and ORM. sql = 'SELECT * FROM ( {} ) T1 NATURAL FULL OUTER

Re: Improve Performance in Admin ManyToMany

2015-05-17 Thread Erik Cederstrand
> Den 15/05/2015 kl. 20.54 skrev Timothy W. Cook : > > def formfield_for_many_to_many(self, db_field, *args, **kwargs): > formfield = super(ClusterAdmin, > self).formfield_for_many_to_many(db_field, *args, **kwargs) > if db_field.name in >

Re: Improve Performance in Admin ManyToMany

2015-05-17 Thread Timothy W. Cook
On Sun, May 17, 2015 at 4:20 PM, Erik Cederstrand wrote: > > I just noticed you have a typo: > > if db_field.name in ['cluster', ... > > should be: > > if db_field.name in ['clusters', ... > > according to your model definition. > > ​Thanks Erik. Yes, that was