Re: new field in models

2013-07-23 Thread Serdar Dalgic
On Mon, Jul 22, 2013 at 10:53 AM, Harjot Mann wrote: > In django when we add a new field in existing class, we need to drop > the table and then run the syncdb again. Is there any alternative for > it so that we can add the field without dropping the table?? > You can

Re: Search from database

2013-07-23 Thread Kamal Kaur
On Wed, Jul 24, 2013 at 5:15 AM, Amirouche Boubekki wrote: > Apache solr or ElasticSearch: yes > Haystack: maybe > Regex: no Thanks. Studying ElasticSearch currently. -- Kamaljeet Kaur kamalkaur188.wordpress.com facebook.com/kaur.188 -- You received this

Re: Search from database

2013-07-23 Thread Amirouche Boubekki
Apache solr or ElasticSearch: yes Haystack: maybe Regex: no 2013/7/21 Kamal Kaur > We can search from database using phonetic codes or queries. I want an > advanced search module in my project. That can suggest similar > spellings from database, if user enters

Problem with chaining filters

2013-07-23 Thread Pepsodent Cola
*1.* I wrote this to make python shell only list Words that have no translation. >>> Word.objects.filter(translation='') [, , ] *2.* How can I use the above filter result and chain it, so that I can make a new list that displays the field *"articulate"*, from the other table "Pronunciation"?

Re: python manage.py runserver error

2013-07-23 Thread Jay Lozier
virtualenv works, this for the link. On Sunday, July 21, 2013 10:09:59 PM UTC-4, Jay Lozier wrote: > > I get the following error when run python manage.py runserver: > > OS openSUSE 12.3 > django 1.7 > > > boopers@linux-nss6:~/myfirstsite> python manage.py runserver > Traceback (most recent call

Re: django-admin.py startproject mysite error

2013-07-23 Thread Jay Lozier
virtualenv seems to work well and I can get django tamed. On Saturday, July 20, 2013 5:55:21 PM UTC-4, Jay Lozier wrote: > > Using openSUSE 12.3 > python 2.7.3 > django 1.5.1 installed manually and verified > > When I enter "django-admin.py startproject mysite" at the command prompt I > get the

Re: How to force modelForm.is_valid() to use a specific database?

2013-07-23 Thread Fred Stluka
Fellipe, See: https://docs.djangoproject.com/en/dev/topics/db/multi-db/ There are a number of ways for force use of a specific database. You can force it per query, per table, or by any other criteria you like. You may need to set up a simple "database router". --Fred

Re: Aggregating annotations

2013-07-23 Thread Debanshu Kundu
This bug has been solved here: https://code.djangoproject.com/ticket/20782 On Friday, July 19, 2013 11:49:52 AM UTC+5:30, Debanshu Kundu wrote: > > If I have a model *Book* defined as: > > class Book(models.Model): >name = models.CharField(max_length=300) >pages = models.IntegerField() >

Re: Aggregating annotations

2013-07-23 Thread Debanshu Kundu
This bug has been solved here: https://code.djangoproject.com/ticket/20782 On Friday, July 19, 2013 10:05:46 PM UTC+5:30, Debanshu Kundu wrote: > > Also interestingly, if I do: > > Book.objects.values('rating').aggregate(Max('rating')) > > It returns an empty dict without performing any DB

Re: How to force modelForm.is_valid() to use a specific database?

2013-07-23 Thread Fellipe Henrique
The problem is: when usng modelForm, it try to validate the unique key in the database, and this validation use a default database.. if I remove primary_key=True in my model, work fine, but I need to set the pk in my model, because when I try to get using: obj.get(xx) show me error... I try

Re: How to force modelForm.is_valid() to use a specific database?

2013-07-23 Thread Brian Millham
I've done that with this code: if form.is_valid(): > f = form.save(commit = False) > f.save(using='yourdatabase') Works fine for me. On Tuesday, July 23, 2013 1:21:29 PM UTC-4, Fellipe Henrique wrote: > > I have many database setted in my setting.py in my formModel, when I try > to

How to force modelForm.is_valid() to use a specific database?

2013-07-23 Thread Fellipe Henrique
I have many database setted in my setting.py in my formModel, when I try to validate the form, show me error: http://stackoverflow.com/questions/17797419/modelforms-and-multiple-datasbase-error-in-form-is-valid The problem is.. is_valid is going to "default" database... how can I force to

How can I upload async files with django-storages

2013-07-23 Thread Nicolas Bases
Hi all, I'm doing a web site where the users can upload some images. These images are uploaded through django-storages [0] to Amazon S3. But it's taking too long to uploaded these files. There is a way where I can upload these images async? Thank you in advance! Nicolas. [0]

Re: Can I only have one "get_queryset" per Viewpage?

2013-07-23 Thread Mário Neto
Exactly @Babatundle =) 2013/7/23 Babatunde Akinyanmi > Override your get method but it's easier to override the get_context_data > method like > # From my head > def get_context_data(**kwargs): > context = super(IndexView, self).get_context_data(**kwargs) >

Re: Foreign Key problems with legacy database

2013-07-23 Thread Nick Dokos
Avraham Serour writes: > you don't need songid = models.Integerfield() ... and the ForeignKey should not specify a db_column. > > On Tue, Jul 23, 2013 at 6:04 AM, Brian Millham wrote: > > I have the following models: > > class

Re: How to Create an Auto Incrementing Integer Field

2013-07-23 Thread Christian Erhardt
you are very welcome -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Foreign Key problems with legacy database

2013-07-23 Thread Avraham Serour
you don't need songid = models.Integerfield() On Tue, Jul 23, 2013 at 6:04 AM, Brian Millham wrote: > I have the following models: > > class Requestlist(models.Model): >>id = models.IntegerField(primary_key=True) >>songid = models.Integerfield() >>song =

RE: Can I only have one "get_queryset" per Viewpage?

2013-07-23 Thread Babatunde Akinyanmi
Override your get method but it's easier to override the get_context_data method like # From my head def get_context_data(**kwargs): context = super(IndexView, self).get_context_data(**kwargs) #filter1 is already present as latest_poll_list in the context filter2 = Word.blah()