Re: Chat application in Django

2010-09-01 Thread Ivan Uemlianin
Dear Shamail As well as the resources already mentioned, I mention a few on this comment on a similar thread in May: http://groups.google.com/group/django-users/browse_thread/thread/6032003efcf2c2df/0575d5b54ecd5254#0575d5b54ecd5254 Hotdot (django, orbited and twisted) is good for realtime

Re: _unicode_ method not working?

2010-09-01 Thread Kevan Stannard
I had the same problem going through the tutorial just now. I quit the interpreter and restarted it and it seemed to pick up the changes. Anyone know a better way to reload changes? Thanks On Sep 2, 4:28 am, Erskine wrote: > Hi, > > I've just started using Django and have been following the 'W

Re: what to do instead of adding to Query.extra_where ?

2010-09-01 Thread Paul Winkler
Hah. That was a pretty long message relative to how quickly I found the answer myself :-p Sorry for the noise. For posterity, extra(where=...) is indeed the solution. I overlooked the obvious: the class I was trying to fix is itself a subclass of QuerySet. So given this line: clone.query.ext

Re: fetching values from model

2010-09-01 Thread commonzenpython
no :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this grou

Re: fetching values from model

2010-09-01 Thread Pradnya
Hey thanks, Is there anyway I can call a function in HTML template? On Sep 1, 6:23 pm, Steve Holden wrote: > On 9/1/2010 9:13 AM, Pradnya wrote:>> ok. Is there any way I can load the > model inside HTML template? > >> What is {% load  %} tag all about? > > The {% load %} tag is for loading cust

Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Graham Dumpleton
On Sep 2, 1:13 pm, Jesse wrote: > I'm using Python 2.7, Apache 2.2 and grabbed the mod_wsgi that > supposedly works.  I changed the name of the file to mod_wsgi and > placed into Apache modules library.  I changed the folders, so the > apache folder by itself and created the following in the apa

Re: fetching values from model

2010-09-01 Thread Pradnya
Hey thanks, Is there anyway I can call a function in HTML template? On Sep 1, 6:23 pm, Steve Holden wrote: > On 9/1/2010 9:13 AM, Pradnya wrote:>> ok. Is there any way I can load the > model inside HTML template? > >> What is {% load  %} tag all about? > > The {% load %} tag is for loading cust

what to do instead of adding to Query.extra_where ?

2010-09-01 Thread Paul Winkler
Hi folks, I'm working on a codebase (a fork of http://code.google.com/p/ebcode/) that is supposed to be run against Django 1.1. It has several lines like this: clone.query.extra_where += ('db_newsitem.id = db_attribute.news_item_id',) That line raises a traceback like this: Traceback (most

Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Jesse
I'm using Python 2.7, Apache 2.2 and grabbed the mod_wsgi that supposedly works. I changed the name of the file to mod_wsgi and placed into Apache modules library. I changed the folders, so the apache folder by itself and created the following in the apache http.conf file: WSGIScriptAlias /myapp

Re: how to add a non-field text property to forms in a formset

2010-09-01 Thread bobhaugen
On Sep 1, 12:17 pm, Bill Freeman wrote: > This seems to me to be a job for the template.  The forms documentation has > a section on custom rendering which shows you how to iterate through the > fields, or access them by name.  You would insert whatever HTML construct > was appropriate for your te

Re: multiple oracle database queries in one request problem

2010-09-01 Thread Steve Holden
On 9/1/2010 5:54 PM, Reinout van Rees wrote: > On 09/01/2010 02:00 PM, Reinout van Rees wrote: >> Hi, >> >> I'm deploying a site on windows with oracle (and I don't know either of >> them well). Simple apache+wsgi setup for now. > > I'll have to test it out tomorrow when I'm near the windows machi

Re: Can't login to admin site

2010-09-01 Thread Karen Tracey
On Wed, Sep 1, 2010 at 1:23 PM, vgarvardt wrote: > Django 1.2.1 > > Created new project, set DB settings (postgresql_psycopg2), > MEDIA_ROOT, MEDIA_URL, TEMPLATE_DIRS, added django.contrib.admin to > INSTALLED_APPS. > > In urls.py uncommented: > from django.contrib import admin > admin.autodiscov

Re: Discrepancy between model formset and the queryset it's based on

2010-09-01 Thread Alec Shaner
Perhaps see: http://docs.djangoproject.com/en/1.2/topics/forms/formsets/ where it talks about the "extra" keyword that controls how many blank forms to add, the default is 1 On Wed, Sep 1, 2010 at 5:31 PM, ses1984 wrote: > Basically I have a queryset with N items in it, which I use to create

Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Graham Dumpleton
On Sep 2, 4:46 am, Jesse wrote: > created project using startproject testproject > > Problems with apache_django_wsgi.conf > 1.  Added following line to Apache: > LoadModule wsgi_module modules/mod_wsgi.so > > 2. Created folder c:/django/testproject/apache > > 3.  Created file c:/django/testproj

Re: multiple oracle database queries in one request problem

2010-09-01 Thread Reinout van Rees
On 09/01/2010 02:00 PM, Reinout van Rees wrote: Hi, I'm deploying a site on windows with oracle (and I don't know either of them well). Simple apache+wsgi setup for now. I'll have to test it out tomorrow when I'm near the windows machine again, but I might have found the solution in an existi

Re: Surreptitious caching of JS in Django

2010-09-01 Thread buddhasystem
I really didn't configure any caching of JS myself, with the exception that it gets served statically. Disabling cache altogether is not an attractive option as my testing goes against expensive queries. Reinout van Rees wrote: > > On 08/30/2010 07:52 PM, buddhasystem wrote: >> >> Hello, >> wi

Re: fetching values from model

2010-09-01 Thread Justin Myers
The only way to access a model from within a template is if the view specifically passed it via the template's context. Even then, you wouldn't be able to do much passing the model _class_ this way; you should be passing specific model _instances_. As the design philosophies doc says, "We see a tem

Discrepancy between model formset and the queryset it's based on

2010-09-01 Thread ses1984
Basically I have a queryset with N items in it, which I use to create a model formset, which then has N+1 items in it. I'm not sure why this is happening. Here is a summary of the problem. Please forgive my crude methods for gathering information (if anyone has feedback on that topic, I would like

Re: PIL on 10.6 = PAIN

2010-09-01 Thread keynesiandreamer
Well last night I started working on removing all traces of PIL and libjpeg as well as the install instructions from Andrews link (Thansk Andrew!) If there was a problem to encounter I seemed to hit it... :-( It all started when Git would not unzip, I finally got that with the xjvf flag I believe

Re: _unicode_ method not working?

2010-09-01 Thread Daniel Roseman
On Sep 1, 7:28 pm, Erskine wrote: > Hi, > > I've just started using Django and have been following the 'Writing > your first Django App' tutorial. So far so good, but I've run into a > little irritation - the use of the _unicode_ method doesn't work for > me. I'm using Django 1.2.1. I'm pretty sur

_unicode_ method not working?

2010-09-01 Thread Erskine
Hi, I've just started using Django and have been following the 'Writing your first Django App' tutorial. So far so good, but I've run into a little irritation - the use of the _unicode_ method doesn't work for me. I'm using Django 1.2.1. I'm pretty sure I've got the indenting right, but when I run

mod_wsgi, apache, windows XP

2010-09-01 Thread Jesse
created project using startproject testproject Problems with apache_django_wsgi.conf 1. Added following line to Apache: LoadModule wsgi_module modules/mod_wsgi.so 2. Created folder c:/django/testproject/apache 3. Created file c:/django/testproject/apache/django.wsgi // code starts import os, s

Re: urlencode in Django

2010-09-01 Thread refreegrata
just a few moments ago i saw this in the django documentation. Now works fine. Thanks. On 1 sep, 12:10, Tom Evans wrote: > On Mon, Aug 30, 2010 at 10:45 PM, refreegrata wrote: > > now works for all characters. I don't  know why, but now finally > > works. ñ is converted to "%C3%B1", ó is convert

Re: Django 1.2 modelformset_factory fails with meta: widgets

2010-09-01 Thread refreegrata
rewrite the __init__., redefining the form element in this place. The error must to dissapear. class FormMyForm(ModelForm): def __init__(self, *args, **kwargs): super(FormMyForm, self).__init__(*args, **kwargs) self.fields[''] = forms.CharField(widget=forms.TextInput(attrs=

Re: url lookup not working?

2010-09-01 Thread Daniel Roseman
On Sep 1, 5:43 pm, eiriks wrote: > I'm reading Bennets Practical Django Projects and I'm stuck on chapter > 6, on templates. > > The error I get is: > "Caught an exception while rendering: Could not import > django.views.generic_list_detail. Error was: No module named > generic_list_detail" > with

Querying a many-to-many field based on entries' number in the relationship

2010-09-01 Thread Jordon Wii
Hi, I have a model named 'Period' and a model named 'Schedule'. They have a many-to-many relationship. I need to get all Period's whose position in the relationship is a certain number (All second periods in each schedule, for example). I could use raw SQL to query the m2m database, but is this

Can't login to admin site

2010-09-01 Thread vgarvardt
Django 1.2.1 Created new project, set DB settings (postgresql_psycopg2), MEDIA_ROOT, MEDIA_URL, TEMPLATE_DIRS, added django.contrib.admin to INSTALLED_APPS. In urls.py uncommented: from django.contrib import admin admin.autodiscover() and (r'^admin/', include(admin.site.urls)), Run manage.py s

url lookup not working?

2010-09-01 Thread eiriks
I'm reading Bennets Practical Django Projects and I'm stuck on chapter 6, on templates. The error I get is: "Caught an exception while rendering: Could not import django.views.generic_list_detail. Error was: No module named generic_list_detail" with this line highlighted: 20 Entries I'v

Re: how to add a non-field text property to forms in a formset

2010-09-01 Thread Bill Freeman
This seems to me to be a job for the template. The forms documentation has a section on custom rendering which shows you how to iterate through the fields, or access them by name. You would insert whatever HTML construct was appropriate for your text, providing a context variable giving its conte

Re: urlencode in Django

2010-09-01 Thread Tom Evans
On Mon, Aug 30, 2010 at 10:45 PM, refreegrata wrote: > now works for all characters. I don't  know why, but now finally > works. ñ is converted to "%C3%B1", ó is converted to "%C3%B3", + to > "%2B", ... > > thanks. > > P.D.: I hate use special characters in an url, generaly is a bad idea, > but is

New Release of ibm_db_django(1.0.1)

2010-09-01 Thread Rahul
IBM_DB_DJANGO-1.0.1 --- IBM_DB_DJANGO adaptor enables access to IBM databases from Django applications http://www.djangoproject.com/. The adaptor is developed and maintained by IBM. What's New? - Fixed LIMIT constraint in select statement with

Re: Django 1.2 modelformset_factory fails with meta: widgets

2010-09-01 Thread Jason
Thanks! I'll give that a try. On Aug 13, 8:55 am, Matthew R wrote: > I got hit by this same bug and here's the workaround I used, for > future reference. Basically you need to specify a formfield_callback > kwarg to modelformset_factory that just passes along any kwargs it > receives (namely, in

Re: seeing HTML code, not the interpreted html

2010-09-01 Thread Bradley Hintze
I just made the HTML in the template using a for loop. DOH!! On Wed, Sep 1, 2010 at 10:38 AM, Bradley Hintze wrote: > Hi all, > > I am playing with iframes for the first time and am gelling some > undesired results. The 'stuff' in my frame shows as HTML code instead > of the expected html 'interp

how to add a non-field text property to forms in a formset

2010-09-01 Thread bobhaugen
I often want to add properties to a formset that will fill a table cell with flexibly wrapping, read-only descriptive text. For example, the description of a product, where the enterable field is the quantity ordered. If I use a field, the widget gets a fixed width and the contents do not wrap (u

seeing HTML code, not the interpreted html

2010-09-01 Thread Bradley Hintze
Hi all, I am playing with iframes for the first time and am gelling some undesired results. The 'stuff' in my frame shows as HTML code instead of the expected html 'interpretation.' I hope that made sense) I am looking to fix this. Here is what I did: I generated a string with all my html in it an

Multiple authentication sources to one database

2010-09-01 Thread Alex
I am trying to write an application that allows two different kinds of authentication: Users in the wild can register and use the site with a new username, password and email and authenticate as usual, and others can use a single-sign-on solution provided by my university. django- cas (http://code.

How is this feature called?

2010-09-01 Thread norus
Hi all, I've decided to start learning Django and Python at the same time. The project I'm working on will help configure Nagios directly from the Django administation page. Here's a sample screenshot of what I've done so far: http://valiyev.net/tmp/progress.png Now my question is as follows, und

Re: Chat application in Django

2010-09-01 Thread yves_s
I also looking for realtime messaging for django and found this two links. http://www.clemesha.org/blog/realtime-web-apps-python-django-orbited-twisted/ http://bitshaq.com/2010/07/30/a-simple-experiment-with-hookbox/ yves -- You received this message because you are subscribed to the Google Gr

Re: {% csrf_token %} template tag not outputting the hidden field

2010-09-01 Thread Jonas Geiregat
I had the same problem some day's ago. Did you add the context_instance parameter in the render_to_reponse function call. It's needed for CSRF to work. For example: return render_to_response('blog/index.html', {'posts': posts}, context_instance=RequestContext(req)) Regards, Jonas. Op 30-aug-20

Re: Django + Postgres

2010-09-01 Thread meitham
> So I have installed postgres, pyscopg2. > > su postgres > created a database > updated my settings.py: > DATABASES = { >     'default': { >         'ENGINE': 'django.db.backends.postgresql_psycopg2', >         'NAME': 'template1', >         'USER': 'postgres', >         'PASSWORD': 'postgres', >

Re: Query overhead or not ?

2010-09-01 Thread Jonas Geiregat
Tag.objects.values('name').annotate(times_used=Count('post__tags')) That's the solution! Op 1-sep-2010, om 15:00 heeft Jonas Geiregat het volgende geschreven: > I look at aggregation and annotation but I don't think It's possible to solve > this by using any of those two systems. > Or am I ove

Re: Chat application in Django

2010-09-01 Thread David Koblas
Two challenges with long polling and Apache/mod_python - * First is that you'll need to have N-user connections open at a minimum based on the number of users you have using the system simultaneously. Thus your memory footprint and performance is going to suffer as the number of users increa

Re: fetching values from model

2010-09-01 Thread Steve Holden
On 9/1/2010 9:13 AM, Pradnya wrote: >> ok. Is there any way I can load the model inside HTML template? >> What is {% load %} tag all about? >> The {% load %} tag is for loading custom tags. Nothing to do with accessing the database. Why do you find it desirable to load records in the template?

Re: fetching values from model

2010-09-01 Thread Jonas Geiregat
I suggest you read the djangobook or some of the django documentation because this is very well documented. Good luck with that! Op 1-sep-2010, om 15:13 heeft Pradnya het volgende geschreven: > ok. Is there any way I can load the model inside HTML template? What > is {% load %} tag all about?

Re: fetching values from model

2010-09-01 Thread Pradnya
ok. Is there any way I can load the model inside HTML template? What is {% load %} tag all about? On Sep 1, 6:02 pm, Jonas Geiregat wrote: > You don't write Python code inside your template file. That's one of the > basic django template rules. > You can pass values from your views to your temp

Re: fetching values from model

2010-09-01 Thread Pradnya
ok. Is there anyway I can load model inside HTML template? or basically what is {% load %} is used for ? On Sep 1, 6:02 pm, Jonas Geiregat wrote: > You don't write Python code inside your template file. That's one of the > basic django template rules. > You can pass values from your views to yo

Re: fetching values from model

2010-09-01 Thread Jonas Geiregat
You don't write Python code inside your template file. That's one of the basic django template rules. You can pass values from your views to your template and show them there. Or generate the HTML in your view and show it from there, which isn't something I could advise if you're creating a larg

Re: Query overhead or not ?

2010-09-01 Thread Jonas Geiregat
I look at aggregation and annotation but I don't think It's possible to solve this by using any of those two systems. Or am I overlooking something ? Op 31-aug-2010, om 13:09 heeft Jonas Geiregat het volgende geschreven: > Thanks for your advise. I'm short of time right now so I briefly looked

fetching values from model

2010-09-01 Thread Pradnya
Hello, Is it possible to fetch a particular record from model using school.object.get(id = 1) inside html template. Please suggest. Thanks Pradnya -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us.

multiple oracle database queries in one request problem

2010-09-01 Thread Reinout van Rees
Hi, I'm deploying a site on windows with oracle (and I don't know either of them well). Simple apache+wsgi setup for now. Problem: one specific page kills off the mod_wsgi/django part. The rest of apache keeps working. "Kill off" meaning "it doesn't react anymore and takes quite some time f

Re: static files

2010-09-01 Thread Reinout van Rees
On 08/30/2010 09:26 PM, Bradley Hintze wrote: base.html ... That "media/xyz.gif" means that if you've got a http://example.com/subdir/test.html page, the image looked up is http://example.com/subdir/media/ajax-loader.gif You probably want "/media/ajax-loader.gif". And: you're apparently

Re: Surreptitious caching of JS in Django

2010-09-01 Thread Reinout van Rees
On 08/30/2010 07:52 PM, buddhasystem wrote: Hello, with the generous help of many of you, I easily set up JSON caching feature in my Django app, in a few views. The problem I'm now facing is that according to what I observe, Django also caches Javascript code in its memcached backend. That's

Re: GeoDjango: default 4326 SRID doesn't work for transform()

2010-09-01 Thread Reinout van Rees
On 08/30/2010 04:14 PM, kyleduncan wrote: Hi, thanks for the tips! to answer your questions: 1. our model doesnt specify a coordinate system, it just saves the lat and lng that are returned from google maps. 2. i thought transforming had to be done to make a lat/lng point "spatial" before dista

Re: PIL on 10.6 = PAIN

2010-09-01 Thread Mathieu Leduc-Hamel
This is because you should not use the Python interpreter from you're Mac installation. Are you using buildout ? VirtualEnv? or nothing ? Buildout: /opt/local/bin/python2.6 bootstrap.py Virtualenv: virtualenv -p /opt/local/bin/python2.6 Nothing: /opt/local/bin/python2.6 manage.py runserver

Django RawQuerySet with Oracle CLOB

2010-09-01 Thread huw_at1
Hi there, I've recently been using the raw() manager method to perform a few more complex SQL queries on my Oracle DB and this has been working very nicely. One particular SQL, however, appears to be giving blank or phantom objects: raw_query_list = list(tmp_class.object.raw(SELECT TO_CHAR(clob_c