Re: Port Django to Javascript

2012-04-05 Thread Lars Ruoff
On Apr 5, 8:48 am, kenneth gonsalves wrote: > frankly these are not questions to be asked of an open source project. On the contrary, many more open source projects should ask themselves that question! I'm very much interested in the answer, since i really don't get it. Why would you re-invent a

Re: Where/how to load global static data?

2012-04-05 Thread kenneth gonsalves
On Wed, 2012-04-04 at 23:56 -0700, Lars Ruoff wrote: > I'd like to know where to put the code that reads these files and > initialzes the global data once and for all at server startup. > I.e. i'd like to have that data in memory and accessible from any > view > during the lifetime of the server, s

Re: Port Django to Javascript

2012-04-05 Thread kenneth gonsalves
On Thu, 2012-04-05 at 00:00 -0700, Lars Ruoff wrote: > On Apr 5, 8:48 am, kenneth gonsalves wrote: > > frankly these are not questions to be asked of an open source > project. > > On the contrary, many more open source projects should ask themselves > that question! I remember a guy, his name h

Re: Where to load global static data?

2012-04-05 Thread Mike Dewhirst
On 5/04/2012 4:53pm, Lars Ruoff wrote: Sorry, that message went off (twice!) while i was in the middle of typing :-) The question is: How do i load static global data once and for all at server startup. I think you would need to implement caching. See https://docs.djangoproject.com/en/dev/top

Improving Site Performance

2012-04-05 Thread Swaroop Shankar V
Hi All, Am developing a site using django and it is almost ready to be launched. Right now am trying to optimize the performance of the site. I have installed the django debug toolbar and when i checked the number of queries being exicuted on the homepage i could see there are 74 queries being exec

Re: Port Django to Javascript

2012-04-05 Thread DvD
Thanks for asking, Marcin. This project started back in 2009 because at that time there was not even a single js mvc framework around that I liked ( at that time the only ones around were JavascriptMVC, Jamal and another one, can't remember the name ). That's the main reason behind this project

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Jaroslav Dobrek
> However, I don't think you need to do this at all. I would say you > would only populate the other fields if they are all empty, and the > base is not empty. If the other fields are not empty, either it has > already been pre-populated, or it has been filled in manually, and you > should not chan

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Xavier Ordoquy
Hi, I'm not sure I clearly understood your issue. Do you want some choice fields to limit their choices according to another choice field value ? Regards, Xavier. Le 4 avr. 2012 à 15:09, Jaroslav Dobrek a écrit : > Hello, > > is there a way to calculate default values for certain fields based

Re: Port Django to Javascript

2012-04-05 Thread sebastien piquemal
I guess the people that don't get the point have probably never made a heavy Javascript application ... Ever used Backbone.js ? client-side - one page - websites are much nicer to use than any website with a page load after every click. So I totally understand why you would do such a project, a

Comparing QuerySets

2012-04-05 Thread Thomas Guettler
I was surprised, that comparing querysets does not work: {{{ from django.contrib.auth.models import User user_id=User.objects.all().order_by('id')[0].id if not User.objects.filter(id=user_id)==User.objects.filter(id=user_id): print 'Not equal? I think they should be' ids1=User.objects.filte

Re: Port Django to Javascript

2012-04-05 Thread Davide Callegari
Hi Sébastien, thanks to the database routing system and the possibility add any backend database (or data source, however you wanna call it) directly into broke, or your project. You can think of it as a sort of plugin system that anyone can use. For instance, if you are using django-piston or d

saving a model instance in a view

2012-04-05 Thread MikeKJ
c = Name.objects.get(trans_id = request.GET.get('trans_id')) if c: u = Name() c.paid = 1 u.save() This isnt saving to same object but adding a blank row and not even changing the boolean value field of paid, someone please point out my error that I cannot see -- You received thi

Re: saving a model instance in a view

2012-04-05 Thread MikeKJ
Gaaah another brain fart, forget this one too -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2lMhuKetxIcJ. To post to this group, send email to django-use

Re: saving a model instance in a view

2012-04-05 Thread kenneth gonsalves
On Thu, 2012-04-05 at 03:51 -0700, MikeKJ wrote: > c = Name.objects.get(trans_id = request.GET.get('trans_id')) > if c: > u = Name() > c.paid = 1 > u.save() if c: c.paid=1 c.save() -- regards Kenneth Gonsalves -- You received this message because you are subscrib

Re: calculate default values for fields based on the content of other fields

2012-04-05 Thread Jaroslav Dobrek
On 5 Apr., 10:40, Xavier Ordoquy wrote: > Hi, > > I'm not sure I clearly understood your issue. > Do you want some choice fields to limit their choices according to another > choice field value ? No. I want to use prepopulated editable char fields. The content of those fields should be calcula

Re: Difficult setup on Suse Linux

2012-04-05 Thread Martin Sommer
Its Django 1.3.1, with Python 2.4.1. The Django docs say that this would work. https://docs.djangoproject.com/en/1.3/intro/install/ Martin -- 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@google

Custom AdminSite and urlresolvers.reverse

2012-04-05 Thread cyrus
Hello, We have implemented three different ModelAdmin sub-classes for the same model, registered under three different AdminSites. Nothing fancy there, only some business logic was implemented differently. After we upgraded from Django 1.2.3 to Django 1.4 these model admins started to fail on t

Re: Problem with Django tutorial

2012-04-05 Thread Rahul Katragadda
> > [04/Apr/2012 14:36:13] "GET */admin/admin/css/*base.css HTTP/1.1" 404 3861 > [04/Apr/2012 14:36:13] "GET */admin/admin/css/*dashboard.css HTTP/1.1" > 404 3876 Is this directory (in bold) correct? On 5 April 2012 00:19, maxim wrote: > Continuing on in the tutorial, I got to the part where i

Unable to open database file

2012-04-05 Thread KriRad
There were so many posts like this and I have looked at them both in the graphite forum as well as this. I see three 'settings.py' files. usr/lib/pymodules/python2.7/django/conf/project_template/ settings.py:DATABASES = { /usr/lib/pymodules/python2.6/django/conf/project_template/ settings.py:DATA

Tweepy Users

2012-04-05 Thread Picomon
Hello, how can I get user's username only in django/ tweepy? I hope you get my point? Thanks. -- 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, sen

Re: Difficult setup on Suse Linux

2012-04-05 Thread Andre Terra
There's a chance you have a logging module in your PATH that is shadowing the default package. Did you create an app or project named logging by any chance? Ideas: - From an interactive python shell, import logging and check logging.__file__ In my Ubuntu install, I get: /usr/lib/python2.7/loggin

[OT] Job offer for django developer

2012-04-05 Thread Marc Aymerich
We are an Spanish based organization looking for a Django developer for an European project related to commuinity networks (guifi.net, FunkFeuer and AWMN). The project is called CONFINE (http://confine-project.eu) and its goal is to create a testbed platform allowing researches to deploy their netw

Users Tweepy

2012-04-05 Thread coded kid
Hi guys, please how can I get a user username in tweepy? I hope you get my point? Thanks! -- 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 em

Re: Where to load global static data?

2012-04-05 Thread Lars Ruoff
On Apr 5, 9:43 am, Mike Dewhirst wrote: > On 5/04/2012 4:53pm, Lars Ruoff wrote: > > > Sorry, that message went off (twice!) while i was in the middle of > > typing :-) > > > The question is: > > How do i load static global data once and for all at server startup. > > I think you would need to imp

Re: Where/how to load global static data?

2012-04-05 Thread Lars Ruoff
On Apr 5, 9:05 am, kenneth gonsalves wrote: > I may be wrong, but AFAIK django is not a server - it is a framework > that runs on a web server, so every new request starts a new instance of > your site. You could use cacheing to serve static data - but this is not > like pre-loading data like one

Re: Where/how to load global static data?

2012-04-05 Thread kenneth gonsalves
On Thu, 2012-04-05 at 05:25 -0700, Lars Ruoff wrote: > the question is not about serving static data (like HTML, images > etc.), but having global python variables initialized once, for all > instances of the site, that is, so they can be used from within each > view. this is precisely the point

Re: Where/how to load global static data?

2012-04-05 Thread Lars Ruoff
On Apr 5, 2:31 pm, kenneth gonsalves wrote: > On Thu, 2012-04-05 at 05:25 -0700, Lars Ruoff wrote: > > the question is not about serving static data (like HTML, images > > etc.), but having global python variables initialized once, for all > > instances of the site, that is, so they can be used f

Re: Where/how to load global static data?

2012-04-05 Thread Tom Evans
On Thu, Apr 5, 2012 at 1:31 PM, kenneth gonsalves wrote: > On Thu, 2012-04-05 at 05:25 -0700, Lars Ruoff wrote: >> the question is not about serving static data (like HTML, images >> etc.), but having global python variables initialized once, for all >> instances of the site, that is, so they can

Re: Where/how to load global static data?

2012-04-05 Thread Lars Ruoff
Thanks a lot, Tom. That magnificantly answers my question. :-) One last thing: "... a function which loads, parses and returns the data, and memoize the result." That (and the first option also) means that we stay within the same Python interpreter environment even for different requests to the

List Users

2012-04-05 Thread coded kid
I’m trying to iterate through user list member in tweepy. When I tried it out, it’s not displaying any user objects! The webpage is just blank. Below are my codes: Views: def listmem(request): consumer_key="XXX" consumer_secret="XXX" access_token="XXX" access_token_secret="XXX"

Re: Where/how to load global static data?

2012-04-05 Thread Tom Evans
On Thu, Apr 5, 2012 at 2:45 PM, Lars Ruoff wrote: > Thanks a lot, Tom. > That magnificantly answers my question. :-) > > One last thing: > > "... a function which loads, parses and returns > the data, and memoize the result." > > That (and the first option also) means that we stay within the same

Re: List Users

2012-04-05 Thread Tom Evans
On Thu, Apr 5, 2012 at 3:00 PM, coded kid wrote: > I’m trying to iterate through user list member in tweepy. When I tried > it out, it’s not displaying any user objects! The webpage is just > blank. Below are my codes: Have you tried spamming the tweepy mailing list instead of the Django one? ht

Re: Where/how to load global static data?

2012-04-05 Thread bruno desthuilliers
On Apr 5, 3:11 pm, Tom Evans wrote: > > OP: I have a couple of solutions. One of the first things the server > does is import your settings, so if you load and parse your static > data at that point, then you will have access to it from that point > onwards. Please dont. Settings are, well, setti

Re: Where/how to load global static data?

2012-04-05 Thread Tom Evans
On Thu, Apr 5, 2012 at 4:20 PM, bruno desthuilliers wrote: > On Apr 5, 3:11 pm, Tom Evans wrote: >> >> OP: I have a couple of solutions. One of the first things the server >> does is import your settings, so if you load and parse your static >> data at that point, then you will have access to it

Re: Comparing QuerySets

2012-04-05 Thread Andre Terra
Not sure if this is efficient, but you can try wrapping the values_list in a set() call. >>> set(ids1) == set(ids2) True >>> set(ids1) & set(ids2) set([1]) >>> ids3 = set([]) >>> r = set(ids1) & set(ids3) >>> r set([]) >>> len(r) 0 Cheers, AT On Thu, Apr 5, 2012 at 6:07 AM, Thomas Guet

how to

2012-04-05 Thread Hum
does max_length work for IntegerFields? -- 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.

Re: how to

2012-04-05 Thread Xavier Ordoquy
Hi, That's for CharFields :) IntergerFields in forms have max_value and min_value. Regards, Xavier, Linovia Le 5 avr. 2012 à 18:12, Hum a écrit : > does max_length work for IntegerFields? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" grou

Re: how to

2012-04-05 Thread dummyman dummyman
no On Thu, Apr 5, 2012 at 9:42 PM, Hum wrote: > does max_length work for IntegerFields? > > -- > 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 grou

Can't display DateField on form with auto_now = True

2012-04-05 Thread Joel Goldstick
I have a model with auto_now, and auto_now_add set for Update and Create fields: class HotelProfiles(models.Model): fe_result_id = models.AutoField(primary_key=True) fe_created_date = models.DateTimeField(verbose_name='Created', blank=True, auto_now_add=True) fe_updated_date = models.Da

Re: ModelForm based on User allows any username without checking

2012-04-05 Thread Pavan Verma
Hi Bastian, you need to define the restrictions on the username field. It can be done by including the code below inside usernameForm. This code is from django/contrib/auth/forms.py -> UserCreationForm, you can refer it to understand further. username = forms.RegexField(label="Username", max_l

Re: Difficult setup on Suse Linux

2012-04-05 Thread Martin Sommer
Thanks Andre, logging.__file__ worked as with your setup, but the issue still remained. I changed to another VM where I have with Ubunto installed, and everything works. Must be the Redhat/Suse vs the Debian/Ubuntu approach. Not something I can spend time on right now. Thanks for your help!! Mar

Re: Where to load global static data?

2012-04-05 Thread Joel Goldstick
On Thu, Apr 5, 2012 at 8:21 AM, Lars Ruoff wrote: > On Apr 5, 9:43 am, Mike Dewhirst wrote: >> On 5/04/2012 4:53pm, Lars Ruoff wrote: >> >> > Sorry, that message went off (twice!) while i was in the middle of >> > typing :-) >> >> > The question is: >> > How do i load static global data once and

Re: Problem with the tutorial.

2012-04-05 Thread J. Cliff Dyer
You might be overriding the DATABASES setting later on in your settings file, or you might not be accessing the settings file you think you're accessing. Try running the following, to see what value you get: $ python manage.py shell >>> from django.conf import settings >>> settings.DATABASES [?]

ADMIN_MEDIA_PREFIX deprecation and using static files

2012-04-05 Thread Rajat Jain
Hi, I have a django 1.3 based frontend and it serves all the static files from Amazon S3. I am wishing to upgrade to Django 1.4. It seems that Django has changed the way admin static files are rendered. I have the following configuration: settings.py: I have the app django.contrib.staticfiles in

Re: Can't display DateField on form with auto_now = True

2012-04-05 Thread Joel Goldstick
On Thu, Apr 5, 2012 at 1:27 PM, Joel Goldstick wrote: > I have a model with auto_now, and auto_now_add set for Update and Create > fields: > class HotelProfiles(models.Model): >    fe_result_id = models.AutoField(primary_key=True) >    fe_created_date = models.DateTimeField(verbose_name='Created'

Django and MS-SQL

2012-04-05 Thread Adolphe Cher-Aime
Hi all, Can anyone share his experience about developing application with django that uses Microsoft SQL server 2005 or later ? And how is it in production environment. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

HttpResponse_is_string is removed Django 1.4

2012-04-05 Thread Rajat Jain
Hi, I have noticed that the class variable HttpReponse._is_string (in django/http/__init__.py) is removed in Django 1.4. I was setting this variable in a couple of places in my code, so that piece of code is breaking in Django 1.4. Do you know if this field is required at all? If not, is it just s

HttpResponse_is_string is removed Django 1.4

2012-04-05 Thread Rajat Jain
Hi, I have noticed that the class variable HttpReponse._is_string (in django/http/__init__.py) is removed in Django 1.4. I was setting this variable in a couple of places in my code, so that piece of code is breaking in Django 1.4. Do you know if this field is required at all? If not, is it ju

Re: Django and MS-SQL

2012-04-05 Thread Python_Junkie
I use it for several applicartions. Not sure that there is any difference with the various versions of sql server, except for minor syntax issues. What did you want to know? The performance is very good. I have one application in which I use the admin interface which uses the ORM and I have a

Comma as decimal field

2012-04-05 Thread ydjango
What is best way to allow users to enter decimal either as "." or as ",'? Currently if user enter "," django forms throw error. I cannot change settings file based on user as same app serves users worldwide. -- You received this message because you are subscribed to the Google Groups "Django us

Connecting User Accounts to Third Party Social Sites

2012-04-05 Thread Chris B
I'm trying to enable my users to connect their accounts with third party social networks like LinkedIn and Github. I don't want my users to be able to create accounts on my site with those links, just connect their existing accounts. Django-SocialRegistration looks best, but I can't figure out

Re: Comma as decimal field

2012-04-05 Thread Python_Junkie
I assume that your problem is that when the data is posted , the ORM when submitting it to the database throws the eror. You need to place the posted value into a variable and use a python replace statement to replace the , with a period. Not sure what type of validation that you are using. P

Re: How to add audio to a Django based webpage?

2012-04-05 Thread Homer
You are right... I fixed that and the webpage can play the audio automatically. But I want to play it when I click it. By the way, on my webpage, the area of Windows Media Player is just a blank... I do not know why. But if I right click it, I can see the menu of Windows Media Player. 在 2012年4月

Re: How to add audio to a Django based webpage?

2012-04-05 Thread Homer
It played the audio automatically after I fixed the stupid space error... However, the area for Windows Media Player (WMP) is still a blank. If I right click it, I can see the menu of WMP And I want to play it when I click it but I cannot... That is the situation right now. 在 2012年4月4日星期三UT

Unable to open database file ( Asking graphite and django forum )

2012-04-05 Thread KriRad
Hi, I have read previous mail in many forums and tried the suggestions. The error is "pysqlite2.dbapi2.OperationalError: unable to open database file" Read/Write permissions are given Command run is sudo /usr/bin/python manage.py syncdb settings.py is DATABASES = { 'default': { 'E