Re: Django help required with non foreign key relations

2012-04-23 Thread akaariai
On Apr 23, 8:15 am, Aditya Sriram M wrote: > Ohh this looks little promising.. > > However, > >    1. I need a few cols of table1 and few from table 2 to be displayed. How >    can we achieve that at the .filter() level? and >    2. At the view level like using the list_display () for displaying t

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread akaariai
On Monday, April 23, 2012 1:56:19 AM UTC+3, Russell Keith-Magee wrote: > > It's also probable that it's something that is new to 1.4 (or, at least, > that it manifests in slightly different ways in 1.4). One of the features > added in 1.4 is bulk insertion of data. This means that you can use a

Logging in by Email isn't responding

2012-04-23 Thread Mai
here i guess i wrote Every thing to be able to log in by mail but it's not working is there something missing please? and AUTHENTICATION_BACKENDS = ( 'mayapp.backends.EmailAuthBackend', 'django.contrib.auth.backends.ModelBackend' ) backends.py from django.conf import settings from django.contri

Re: Cross domain cookie to extract csrf token

2012-04-23 Thread Luther Goh Lu Feng
I have managed to resolve the issue. This only works on phonegap, chrome 20 but not on desktop safari 5.1.5. General strategy: - Make an ajax OPTIONS call to http://foo - Generate the csrf token and return it in the success callback - Extract the csrf token - In the success callback do the ajax po

restarting a django development server

2012-04-23 Thread dummyman dummyman
how to restart a django development server programmatically in python ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-use

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread Javier Guerra Giraldez
On Mon, Apr 23, 2012 at 3:58 AM, akaariai wrote: > The last one, qs.filter(id__in=large_list) is pretty much impossible to fix. what's wrong with: qs.filter((Q(id__in=large_list[:n])|Q(id__in=large_list[n:]))) ? >   1. Use different database. I guess you have a reason to use SQLite so this > m

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread akaariai
On Apr 23, 1:43 pm, Javier Guerra Giraldez wrote: > On Mon, Apr 23, 2012 at 3:58 AM, akaariai wrote: > > The last one, qs.filter(id__in=large_list) is pretty much impossible to fix. > > what's wrong with: > > qs.filter((Q(id__in=large_list[:n])|Q(id__in=large_list[n:])))  ? > > >   1. Use differe

Loading static files from a dev environment

2012-04-23 Thread gnesher
I'm having an odd problem with my test Django environment. It seems that static filles I've collected from different apps using the collectstatic command works fine, while other static files I placed in myself result in 404 error. This can happen from the same directory (where a png that was colle

Django static files STATIC_ROOT vs STATICFILES_FINDERS

2012-04-23 Thread gnesher
Hi, I'm not sure if this is a bug or am I missing something but I've created a very simple test environment and placed a single png file within my static folder. The file is being served fine when I set : STATIC_ROOT = '' STATICFILES_DIRS = ( '/Users/guynesher/Work/play/quicktest/testproj/sta

Re: Django static files STATIC_ROOT vs STATICFILES_FINDERS

2012-04-23 Thread Philip Mountifield
There is a slight difference: * STATIC_ROOT is where you would like the files to be collected to when you run "manage.py collectstatic" and should be empty to begin with. * STATICFILES_DIRS is where the actual files are located and they will be automagically servered under the developm

Re: keep models simple ? where to put the business logic ?

2012-04-23 Thread bruno desthuilliers
On Apr 22, 7:51 pm, Michael Palumbo wrote: > Hi, > > I know this has already been discussed several times, I found several posts > about it through Google but I'm still interested in getting your opinion on > an example. > > I'm wondering that because my models file is getting big. That makes me >

Re: request.is_ajax() not working

2012-04-23 Thread psychok7
yes i did that now, and still doesnt work.. it still returns false and doesnt print the line after request.is_ajax() On Monday, April 23, 2012 4:36:06 AM UTC+1, Amao wrote: > > dear psychok7: > You have no data from your ajax post, you should post some data with > your ajax post, like this

Re: Django static files STATIC_ROOT vs STATICFILES_FINDERS

2012-04-23 Thread gnesher
But then shouldn't I expect the files to be served from the STATIC_ROOT as well ? On Apr 23, 12:38 pm, Philip Mountifield wrote: > There is a slight difference: > >   * STATIC_ROOT is where you would like the files to be collected to >     when you run "manage.py collectstatic" and should be emp

Re: How to syncdb programatically (django standalone script) ?

2012-04-23 Thread Fábio Santos
There's a problem in your INSTALLED_APPS setting. You have to use: ('polls',) Notice the trailing comma. When writing tuples with one item, you must have a traling comma. It indicates that you are writing a tuple, and not simply an expression enclosed in parenthesis. A workaround is to use a li

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread Lukas Zilka
Hey Russ, thanks for your reply. I looked at the bulk insertion problem, and that made me think that probably using the variables themselves is the problem. It does not really make sense to me why anybody bothers to use variables in a long SQL query for the IN clause, let alone a bulk insertion? D

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread Lukas Zilka
Thanks for your reply Anssi. My previous post probably got lost somewhere (or maybe just awaiting moderation?), so I am going to repeat the relevant part. It is related with your point on qs.filter(id__in=large_list), so I will try to say it again. Why do you use SQL variables when you construc

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Joel Goldstick
On Sun, Apr 22, 2012 at 12:59 PM, Aaron C. de Bruyn wrote: > This has been asked eleventy bajillion times, but I don't see a wiki > page on it?  :) > > I'd be happy to dig through the archives and compile a list if there's > no objection. > > Would there be a problem including for-pay IDEs?  (For

Re: Ways to handle long-running server-side processing in Django

2012-04-23 Thread bruno desthuilliers
On Apr 21, 11:34 pm, David Markey wrote: > Sounds like the API should return a UUID that can then be used to poll, > while celery or similar does the heavy lifting in the background? +1 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Timothy Makobu
If you can spare a few bux, get PyCharm. It's the best. On Mon, Apr 23, 2012 at 2:51 PM, Joel Goldstick wrote: > On Sun, Apr 22, 2012 at 12:59 PM, Aaron C. de Bruyn > wrote: > > This has been asked eleventy bajillion times, but I don't see a wiki > > page on it? :) > > > > I'd be happy to dig t

Re: Django static files STATIC_ROOT vs STATICFILES_FINDERS

2012-04-23 Thread Philip Mountifield
It depends how you are running. When using "manage.py runserver" it serves the static files for you, without even needing to collect them IIRC. But when deploying, you have to run "manage.py collectstatic" and Django collects all the files from the other locations for you and puts them in STATI

Re: New to Jdango - What IDE to use?

2012-04-23 Thread kenneth gonsalves
On Mon, 2012-04-23 at 14:54 +0300, Timothy Makobu wrote: > If you can spare a few bux, get PyCharm. It's the best. they give open source licenses for free. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Timothy Makobu
I have one of those actually, but that's coz I have a project that's been around a while. They actually checked out the googlecode page. On Mon, Apr 23, 2012 at 3:00 PM, kenneth gonsalves wrote: > On Mon, 2012-04-23 at 14:54 +0300, Timothy Makobu wrote: > > If you can spare a few bux, get PyCharm

Distributing Django apps

2012-04-23 Thread Steve Kilbane
Hi all, I'm new to Python. I'm in the process of developing an open-source app. Is there a guide for packaging up and distributing Django apps? Or is it just a matter of copying the relevant files? steve -- You received this message because you are subscribed to the Google Groups "Django users

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread akaariai
On Apr 23, 10:48 am, Lukas Zilka wrote: > Hey Russ, > > thanks for your reply. I looked at the bulk insertion problem, and > that made me think that probably using the variables themselves is the > problem. It does not really make sense to me why anybody bothers to > use variables in a long SQL

Re: New to Jdango - What IDE to use?

2012-04-23 Thread kenneth gonsalves
On Mon, 2012-04-23 at 15:01 +0300, Timothy Makobu wrote: > I have one of those actually, but that's coz I have a project that's > been > around a while. They actually checked out the googlecode page. for me too -- regards Kenneth Gonsalves -- You received this message because you are subscribe

Re: Distributing Django apps

2012-04-23 Thread Eugenio Minardi
Hi, You can have a look at http://pypi.python.org/pypi/django-fagungis/ -- Eugenio On Mon, Apr 23, 2012 at 2:00 PM, Steve Kilbane wrote: > Hi all, > > I'm new to Python. I'm in the process of developing an open-source > app. Is there a guide for packaging up and distributing Django apps? > Or i

Re: Django static files STATIC_ROOT vs STATICFILES_FINDERS

2012-04-23 Thread gnesher
I'm running manage.py runserver (on the dev environment) the only reason I'm asking this is because I'm quite certain on my previous installs (Django 1.3) it worked fine On Apr 23, 12:54 pm, Philip Mountifield wrote: > It depends how you are running. When using "manage.py runserver" it > serves t

call_command('syncdb') in virtualenv failing: Error: No module named staticfiles

2012-04-23 Thread Stodge
I'm trying to port an existing app to Django 1.4 so I'm using virtualenv. ./manage.py syncdb works but my old script that calls syncdb and creates dummy data doesn't. My code: os.environ["DJANGO_SETTINGS_MODULE"]="settings" call_command('syncdb', interactive=False) is giving: Error: No module

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Thomas Weholt
Me too. I got a open source license for PyCharm for DSE, but it expires tomorrow and I'm not sure if I have to buy a new developer license or not. Emailed the Pycharm-boys about this, wondering if I could extend my open source license but haven't heard anything so far. Anyhow, PyCharm is great and

Re: call_command('syncdb') in virtualenv failing: Error: No module named staticfiles

2012-04-23 Thread Stodge
Bah - I completely forgot that my gen.py script had this : #!/usr/bin/python On Monday, 23 April 2012 07:26:55 UTC-5, Stodge wrote: > > I'm trying to port an existing app to Django 1.4 so I'm using virtualenv. > ./manage.py syncdb works but my old script that calls syncdb and creates > dummy da

Re: request.is_ajax() not working

2012-04-23 Thread psychok7
i am using Chrome. to be honest i dont really understand everything you are talking about, so ill just try to run your code and see if i can get results on the other hand if i use GET instead of POST i dont have to worry about CSRF right? i am not sure you understood my question though, i am g

Re: request.is_ajax() not working

2012-04-23 Thread Masklinn
On 2012-04-23, at 14:44 , psychok7 wrote: > i am using Chrome. > > to be honest i dont really understand everything you are talking about, so > ill just try to run your code and see if i can get results > on the other hand if i use GET instead of POST i dont have to worry about > CSRF > right

Re: Distributing Django apps

2012-04-23 Thread Steve Kilbane
Marvellous! I shall take a look. Thanks. On Apr 23, 1:19 pm, Eugenio Minardi wrote: > Hi, > > You can have a look athttp://pypi.python.org/pypi/django-fagungis/ > > -- Eugenio > > On Mon, Apr 23, 2012 at 2:00 PM, Steve Kilbane > wrote: > > > > > > > > > Hi all, > > > I'm new to Python. I'm in th

[no subject]

2012-04-23 Thread Karen Tracey
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at

Re: restarting a django development server

2012-04-23 Thread Joel Goldstick
On Mon, Apr 23, 2012 at 6:10 AM, dummyman dummyman wrote: > how to restart a django development server programmatically in python ? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googleg

Re: restarting a django development server

2012-04-23 Thread Joel Goldstick
On Mon, Apr 23, 2012 at 9:16 AM, Joel Goldstick wrote: > On Mon, Apr 23, 2012 at 6:10 AM, dummyman dummyman wrote: >> how to restart a django development server programmatically in python ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" gro

Problem with get_or_create

2012-04-23 Thread Murilo Vicentini
Hey guys, I'm having a bit of a problem using the get_or_create with a ManyToManyField in my model. class Run(models.Model): distros = models.ForeignKey('Distro') compilers = models.ManyToManyField('Compiler', blank=True, null=True) adapters = models.ForeignKey('Adapter')

Re: keep models simple ? where to put the business logic ?

2012-04-23 Thread Javier Guerra Giraldez
On Mon, Apr 23, 2012 at 6:47 AM, bruno desthuilliers wrote: > Models - like any other module - should indeed be "as simple as > possible", _but not simpler_. If you concern is about your models.py > file size, it might be time to refactor it into a package. or maybe the app has to be more focused

Re: YAML Fixture is not working. DeserializationError

2012-04-23 Thread James Rivett-Carnac
Your yaml doesn't seem to be correctly formated, should be: - model: translations.Language pk: 1 fields: code: fr display_name: Français - model: translations.Language pk: 2 fields: code: en display_name: English model, pk, and fields are all on the same indentatio

cannot locate syntax error in urls.py

2012-04-23 Thread r0pewalker
Hi everybody. I recently started working on a project involving heavy Django usage. I basically retrieve data in xml from a SOAP web service using suds, parse the xml into a db and then (I should) popuate a web page. I'm a beginner both in Python and Django, please bear with me and my possibly ill

Re: cannot locate syntax error in urls.py

2012-04-23 Thread Daniel Roseman
On Monday, 23 April 2012 15:03:35 UTC+1, r0pewalker wrote: > > Hi everybody. I recently started working on a project involving heavy > Django usage. > I basically retrieve data in xml from a SOAP web service using suds, > parse the xml into a db and then (I should) popuate a web page. > I'm a

Re: Ignoring empty forms in a formset

2012-04-23 Thread Martin Tiršel
Nobody knows how to ignore empty forms in a formset? I have to write some custom method on a form that checks all fields and returns False if any of the fields is filled or is there any other solution? Martin On Sunday, April 22, 2012 6:44:53 PM UTC+2, Martin Tiršel wrote: > > Hello, > > I have

Re: Ignoring empty forms in a formset

2012-04-23 Thread Marcin Tustin
You will want to edit the management form values on the client side, as described in the documentation. On Mon, Apr 23, 2012 at 15:42, Martin Tiršel wrote: > Nobody knows how to ignore empty forms in a formset? I have to write some > custom method on a form that checks all fields and returns Fals

Re: restarting a django development server

2012-04-23 Thread dummyman dummyman
hi but how do i do it when the server is running ?? i basically want to stop it and restart it in the program is it possible ? On Mon, Apr 23, 2012 at 6:54 PM, Joel Goldstick wrote: > On Mon, Apr 23, 20ogr12 at 9:16 AM, Joel Goldstick > wrote: > > On Mon, Apr 23, 2012 at 6:10 AM, dummyman dummy

Re: keep models simple ? where to put the business logic ?

2012-04-23 Thread Daniel Sokolowski
To alleviate models.py file growing large you can split it up like so /models/ /models/__init__.py /models/invoices.py /models/products.py /models/taxes.py ... The are two tricks to the above to make it work however; first you must import your files in the __init__.py and manually specify the a

Re: restarting a django development server

2012-04-23 Thread dummyman dummyman
basically i ve a form in a class CollFormAdmin where i am overriding two fields to MultipleChoiceField where values are changed dynamically based on a pickle file value then in CollAdmin class class CollAdmin(admin.ModelAdmin): form=CollFormAdmin but i want to change the value of MultipleCho

Re: cannot locate syntax error in urls.py

2012-04-23 Thread r0pewalker
My bad. Thanks for the quick hint, turns out I was not looking the right way.. On 23 Apr, 16:42, Daniel Roseman wrote: > On Monday, 23 April 2012 15:03:35 UTC+1, r0pewalker wrote: > > > Hi everybody. I recently started working on a project involving heavy > > Django usage. > > I basically retriev

Re: Problem with get_or_create

2012-04-23 Thread akaariai
On Apr 23, 4:26 pm, Murilo Vicentini wrote: > Hey guys, > I'm having a bit of a problem using the get_or_create with a > ManyToManyField in my model. > class Run(models.Model): >         distros = models.ForeignKey('Distro') >         compilers = models.ManyToManyField('Compiler', blank=True, > nu

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Daniel Sokolowski
Eclipse + PyDev + whatever else you want; if you need it more often then not there is a plugin for it. This IDE just becomes more and more powerful as you keep learning it through use; note Aptana is a rebranded Eclipse+PyDev however I still prefer vanilla Eclipse + plugins. My list of plugi

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Daniel Sokolowski
To add: install the Eclipse "Marketplace Client" plugin and use that to locate your plugins. -Original Message- From: Daniel Sokolowski Sent: Monday, April 23, 2012 11:44 AM To: Django users Subject: Re: New to Jdango - What IDE to use? Eclipse + PyDev + whatever else you want; if you

Re: Problem with get_or_create

2012-04-23 Thread Denis Darii
Murilo, try to debug your "task" variable - must be an int. Also next time please provide full traceback of your error. On 23 April 2012 17:42, akaariai wrote: > On Apr 23, 4:26 pm, Murilo Vicentini > wrote: > > Hey guys, > > I'm having a bit of a problem using the get_or_create with a > > Many

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread Daniel Sokolowski
+1 I use SQlite3 on lower traffic production sites due to it's ease of install and deployment. Even though I only once I reached this 1000 variable limit I would like to see some django work around. -Original Message- From: akaariai Sent: Monday, April 23, 2012 8:06 AM To: Django

Form logic query

2012-04-23 Thread David
Hello Given the following models: CHOICES = ( (0, u'AM'), (1, u'PM'), ) class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) class PersonStuff(models.Model): person = models.ForeignKey(Person) stuff = mode

Re: restarting a django development server

2012-04-23 Thread Bill Freeman
You can "touch" one of the .py files. That is, cause its last modified date to become newer than that of its .pyc file by making it the current time. I suspect that you can do this (assuming that you don't want to run the *nix "touch" command as a sub process, or don't have it because you are on

Re: Django deployment practices -- do people use setup.py?

2012-04-23 Thread Daniel Sokolowski
Both, system libraries and not python files --- anything outside of Python land that PIP can’t handle. How do you handle that if you want a self contained easy to deploy project? From: Andrew Cutler Sent: Saturday, April 21, 2012 12:58 AM To: django-users@googlegroups.com Subject: Re: Django d

Re: restarting a django development server

2012-04-23 Thread dummyman dummyman
awesome man :) it worked On Mon, Apr 23, 2012 at 9:39 PM, Bill Freeman wrote: > You can "touch" one of the .py files. That is, cause its last modified > date to become newer than that of its .pyc file by making it the current > time. > > I suspect that you can do this (assuming that you don't w

Re: Bus Error: 10 (Intro Tutorial)

2012-04-23 Thread Nikolas Stevenson-Molnar
I would try reinstalling Python and Django. This seemed to resolve the issue of the original poster. _Nik On 4/21/2012 3:18 PM, James wrote: > I just started receiving the same error "Bus error: 10". I made a > small code change and > it suddenly appeared. I've reverted but that doesn't seem to m

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Aaron C. de Bruyn
Ok--wiki page here: https://code.djangoproject.com/wiki/DjangoResources#IntegratedDevelopmentEnvironments Now we can stop the 'IDE' threads that come up every few weeks. :) It's not a complete list--I just wanted to bash something out quickly and let others add their favorites that I missed. -A

Re: Bus Error: 10 (Intro Tutorial)

2012-04-23 Thread James
I found the problem. I had overridden __getattr__ and returned self.value which did not yet exist on the object. This caused a maximum recursion depth RuntimeError. I'm still not sure why this became "Bus error: 10", however. James Leard On Apr 23, 1:31 pm, Nikolas Stevenson-Molnar wrote: > I wo

Re: restarting a django development server

2012-04-23 Thread Andy McKay
Change your code so you don't have to. Relying on a restart for that is the wrong approach. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-23 Thread akaariai
On Apr 23, 6:54 pm, "Daniel Sokolowski" wrote: > +1 > > I use SQlite3 on lower traffic production sites due to it's ease of install > and deployment. Even though I only once I reached this 1000 variable limit I > would like to see some django work around. I thought a little more about this, and I

How to create a custom widget?

2012-04-23 Thread Corbin Tarrant
I'm new to django and trying to create my first application and am having some difficulty. I created another post last week but haven't gotten any response. I did get some response in the IRC channel though and it was mentioned that I could use a custom widget to get the job done. I have been l

Re: How to create a custom widget?

2012-04-23 Thread Corbin Tarrant
Here is my original post that describes what I'm trying to do: https://groups.google.com/forum/?fromgroups#!searchin/django-users/corbin/django-users/hJzxsm63WC8/AOD_NAoAhaYJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussi

EmailMessage hangs in Windows

2012-04-23 Thread CrabbyPete
I am using from django.core.mail import EmailMessage and I have the following code msg = EmailMessage ( subject = subject, body = body, from_email = sender, to

Updating custom permissions in a view

2012-04-23 Thread bfrederi
Does anyone know why create_permissions doesn't work (or throw any errors) when used in a view, but works when I run the same code in the manage.py shell? ## views.py ### from django.db.models import get_app from django.contrib.auth.management import create_permissions from django.http imp

Re: Audio Streaming from server

2012-04-23 Thread atul khairnar
Can I stream the audio using Django without Icecast2? If yes, How? On Apr 20, 12:12 pm, yati sagade wrote: > Hi, > You need to be much more specific. If the problem is related to Django, > someone will help you out. But if it is help with Icecast2 you're looking > for, you should probably try the

Re: EmailMessage hangs in Windows

2012-04-23 Thread Phang Mulianto
Hi, What s the error msg.. It should smtp error message. Maybe your smtp mail server setting.what mta you use? How many often you sent the email? Maybe your smtp still busy processing other mail. On Apr 24, 2012 7:42 AM, "CrabbyPete" wrote: > I am using > from django.core.mail i