Re: django and ldap

2010-02-04 Thread andreas schmid
Mike Dewhirst wrote: > On 4/02/2010 11:14pm, David De La Harpe Golden wrote: >> On 04/02/10 08:33, andreas schmid wrote: >>> @brad: can you show me some sample code for this? >>> > > David > > I am using Peter Herndon's django-ldap-groups successfully. He has two > backends; one for Novell's

[ANN] djangogolf

2010-02-04 Thread Kenneth Gonsalves
Hi, I just released djangogolf - software for managing golf tournaments. The scoring module is ready, handicapping and draw are in the pipeline. The demo site is here: http://greenchilly.in/ - feedback, feature requests and contributions are welcome. -- regards Kenneth Gonsalves Senior

Re: update with where clause constraints?

2010-02-04 Thread Karen Tracey
On Thu, Feb 4, 2010 at 8:08 PM, Jared Smith wrote: > My use case is that I'll have multiple users trying to update a set of > objects and I want to make sure that any user committing a change has > knowledge of the existing state. I was going to model that with a version

update with where clause constraints?

2010-02-04 Thread Jared Smith
My use case is that I'll have multiple users trying to update a set of objects and I want to make sure that any user committing a change has knowledge of the existing state. I was going to model that with a version number so an update would look like: update table set col=foo, col1=bar where

Re: django and ldap

2010-02-04 Thread Mike Dewhirst
On 4/02/2010 11:14pm, David De La Harpe Golden wrote: On 04/02/10 08:33, andreas schmid wrote: @brad: can you show me some sample code for this? David I am using Peter Herndon's django-ldap-groups successfully. He has two backends; one for Novell's eDirectory which I'm using and another

Re: Ajax with Django

2010-02-04 Thread Prashanth
On Fri, Feb 5, 2010 at 2:49 AM, Rohan Shah wrote: > Any good documentation available on how to implement AJAX with Django ? > http://www.b-list.org/weblog/2006/jul/31/django-tips-simple-ajax-example-part-1/ -- regards, Prashanth twitter: munichlinux blog:

Re: Ajax with Django

2010-02-04 Thread Jonathan Orlando
http://code.google.com/p/dojango/ What is dojango Dojango is a reusable django application that helps you to use the client-side framework dojo within your django project. - It provides capabilites to easily switch between several dojo versions and sources (e.g. aol, google, local) -

Re: Ajax with Django

2010-02-04 Thread Gonzalo Delgado
El 04/02/10 18:19, Rohan Shah escribió: > Any good documentation available on how to implement AJAX with Django ? http://lmgtfy.com/?q=django+ajax=1 -- Gonzalo Delgado -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-04 Thread mrts
See http://code.djangoproject.com/ticket/12780 . I will upload a patch and provide an example, but I can't yet say when. Best, Mart Sõmermaa On Jan 15, 8:10 pm, Gabriel Reis wrote: > Hey Marcos, > > In the clean() method of my ClipModelForm class I couldn't manage how to

Ajax with Django

2010-02-04 Thread Rohan Shah
Any good documentation available on how to implement AJAX with Django ? -- Thanks and Regards, Rohan Shah ++[>>++>+++>+-] >++. >+++.---. ---.. >++. <<+. >--. ---.+++. -- You received this message because you are subscribed

Re: django-debug-toolbar with runserver not running on localhost

2010-02-04 Thread HARRY POTTRER
gah you're correct, I can't believe I missed that setting. thanks On Feb 4, 4:48 pm, rebus_ wrote: > On 4 February 2010 22:06, HARRY POTTRER wrote: > > > I've noticed that if I run the django dev server on localhost, debug- > > toolbar works, but if I try

Re: django-debug-toolbar with runserver not running on localhost

2010-02-04 Thread rebus_
On 4 February 2010 22:06, HARRY POTTRER wrote: > I've noticed that if I run the django dev server on localhost, debug- > toolbar works, but if I try to run he server like this: > > ./manage.py runserver 192.168.1.145:8000 > > the site will work, but the toolbar won't show up.

entering scores (one model) for a list of students (another model)

2010-02-04 Thread Tim Arnold
I'm creating a form that students fill in as they arrive at class. Just name, email, etc. When the class is over I want to display a form for the teacher to enter the grades. So, no problem on the students entering their info, I just have a Student model. I have a Score model that has the score

django-debug-toolbar with runserver not running on localhost

2010-02-04 Thread HARRY POTTRER
I've noticed that if I run the django dev server on localhost, debug- toolbar works, but if I try to run he server like this: ./manage.py runserver 192.168.1.145:8000 the site will work, but the toolbar won't show up. Is there a work- around for this? -- You received this message because you

Re: how to activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
Thanks a lot, i did miss to pass context_instance=RequestContext(request) in my view code def access(request): return render_to_response('tool.html',context_instance=RequestContext(request)) after I added "context_instance=RequestContext(request)" It is working now like a charm!

Re: how to activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread Karen Tracey
On Thu, Feb 4, 2010 at 2:39 PM, weiwei wrote: > Thanks.. > > Here is my code > > You repeated the code for the template tag and the context processors setting; that's not what I asked for. I still don't see the code for the view that renders the template that

Re: how to activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
Thanks.. Here is my code from django import template from django.template import RequestContext register = template.Library() @register.inclusion_tag('userinfo.html',takes_context = True) def userinfo(context): request = context['request'] address = request.session['address']

Trying to get an image in a RadioSelect

2010-02-04 Thread Jeffrey Taggarty
Hi, I am trying to get an image as a label in a RadioSelect... I have been trying to get a grasp on using the RadioFieldRenderer() but I am having no luck. I currently have this in my widgets.py from django.forms import widgets from django.utils.encoding import force_unicode from

When does syncd create new tables

2010-02-04 Thread Joakim Hove
Hello, I am developing my models. I have quite a lot of legacy data which I have to take into account, so I try hard to understand the logic of syncdb. My current situation is as follows: 1. I had written the model defintion of several models in Python and created the corresponding tables with

Re: how to activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread Karen Tracey
On Thu, Feb 4, 2010 at 1:41 PM, weiwei wrote: > "DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST > If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every > RequestContext will contain a variable request, which is the current > HttpRequest. Note that this processor is

Re: CheddarGetter module for Django/Python - easy recurring billing

2010-02-04 Thread Eric Chamberlain
On Feb 1, 2010, at 1:11 PM, Jason Ford wrote: > Anyone who's built commercial web app knows that payment processing > can be one of the toughest pieces to put in place - and it can > distract you from working on the core functionality of your app. > CheddarGetter is a web service that abstracts

Re: It looks like Django is working from a stale DB. What am I doing wrong?

2010-02-04 Thread Karen Tracey
On Thu, Feb 4, 2010 at 12:02 PM, Luke Sneeringer wrote: > Good morning, everyone! > Apologies in advance if this is the wrong place to ask this question. > > First of all, the setup. I'm using MySQL and InnoDB tables. > > I've encountered an unusual problem, which has

Re: django and ldap

2010-02-04 Thread brad
On Feb 4, 2:33 am, andreas schmid wrote: > @brad: can you show me some sample code for this? the code that I have is all very specific to where I work. I'd have to clean it up a bit to try to make it useful to you. There's also several other people who have posted

Is there a way to access a field's verbose_name from a object_list generic view template?

2010-02-04 Thread Eric Chamberlain
I'm using the object_list generic view and it seems there should be a way to pull the field verbose_name from the model, without having to hard code the name in the template. Any suggestions? -- Eric Chamberlain -- You received this message because you are subscribed to the Google Groups

Re: Django standards?

2010-02-04 Thread Phlip
On Feb 4, 10:29 am, David Parker wrote: > Right on.  I haven't gotten much into testing Django yet.  My previous > experience is with Rails (RSpec/Shoulda/Cucumber) and Java (JUnit).  I > plan on actually driving my app with TDD, but I was curious to know > which "way" most

how to activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
"DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every RequestContext will contain a variable request, which is the current HttpRequest. Note that this processor is not enabled by default; you'll have to activate it. " from this page

Re: Django standards?

2010-02-04 Thread David Parker
Right on. I haven't gotten much into testing Django yet. My previous experience is with Rails (RSpec/Shoulda/Cucumber) and Java (JUnit). I plan on actually driving my app with TDD, but I was curious to know which "way" most developers in the Django arena code their url patterns (granted, I

uniquely identifying an entry

2010-02-04 Thread harryos
hi (sorry about this newbie question..) I have designed an entry and a category as follows. The entry doesn't have a title.(The user is not expected to provide a title for it )It is uniquely identified by a combination of its published datetime and the name of the category it belongs to. class

Re: Django standards?

2010-02-04 Thread Phlip
David Parker wrote: >     verses = Verse.objects.filter(version__iexact=version, > book__iexact=book, chapter__iexact=chapter, verse__iexact=verse) >   else: >     logging.debug("chapter: " + chapter) >     logging.debug("verse  : " + verse) >     logging.debug("verse2 : " + verse2) > Now, is

Re: Please Help With POST Problem

2010-02-04 Thread Bill Freeman
If you are running behind, for example, apache, and the content type headers are correct, apache might expand the gzip stuff for you. I wouldn't be surprised to find that the python/django http request stuff doesn't handle gzip, but it might. It might be possible to return an error response

Re: Django bases blog solutions

2010-02-04 Thread Joel Stransky
Thanks a ton Peter. I totally agree that I should just write my own since that is exactly the type of thing django was built to do and I intend on doing so. The reason I ask is that I tend to learn much faster by examining good examples. On Thu, Feb 4, 2010 at 11:09 AM, Peter Herndon

Re: How to use CheckboxSelectMultiple() widget

2010-02-04 Thread Bill Freeman
I'll take you at your word that you have a list of file (names?), rather than a queryset. class xxx(forms.Form): def __init__(self, list_of_files, *args, **kwargs): self.fields['files'].choices = enumerate(list_of_files) super(xxx, self).__init__(*args, **kwargs) files =

Re: Access apache environment variable in template

2010-02-04 Thread Sonal Breed
Ya, It did work luke, What was I thinking, accessing it like {{ request.meta["TIER"] }} Sorry for that and thanks again for your help. Sonal On Feb 4, 9:30 am, Sonal Breed wrote: > I mean to say {{ request.meta["TIER"] }} > > On Feb 4, 9:25 am, Sonal Breed

Re: Access apache environment variable in template

2010-02-04 Thread Luke Sneeringer
If you are using render_to_response, you will need to explicitly send request in the dictionary of items going to the template. Also, variable access in Django templates is done with the {{ and }} enclosure, and uses all dots (.) for separators. I have never tried to directly access something

Re: Access apache environment variable in template

2010-02-04 Thread Sonal Breed
I mean to say {{ request.meta["TIER"] }} On Feb 4, 9:25 am, Sonal Breed wrote: > Hi all, > In my default-server.conf, I set an env variable as > setenv TIER hi > > Can anybody let me know how can I access this variable in the > template. > I tried to use a bunch of

Access apache environment variable in template

2010-02-04 Thread Sonal Breed
Hi all, In my default-server.conf, I set an env variable as setenv TIER hi Can anybody let me know how can I access this variable in the template. I tried to use a bunch of expressions like {% request.meta["TIER"] %} or {% request.environ[TIER] %} but they do not return anything. Any help will

Re: FieldError with get_object_or_404

2010-02-04 Thread Andy McKay
On 2010-02-04, at 7:36 AM, harryos wrote: > In the shell I tried this > from django.shortcuts import get_object_or_404 as gtobj > e1=gtobj(MyEntry,posted_time__year=2010,posted_time__month=2,posted_time__day=1) > This is successful ,it gives this message > MultipleObjectsReturned: get() returned

It looks like Django is working from a stale DB. What am I doing wrong?

2010-02-04 Thread Luke Sneeringer
Good morning, everyone! Apologies in advance if this is the wrong place to ask this question. First of all, the setup. I'm using MySQL and InnoDB tables. I've encountered an unusual problem, which has reared its ugly head on several fronts. The basic jist is that Django seems to not recognize

[ANN] Morelia - a BDD framework for Python

2010-02-04 Thread Phlip
Djangoists: Morelia /viridis/ is a Behavior Driven Development system for Python. We use Morelia on all our private Django projects here at http://github.com/cuker . (Other than that, Morelia itself does not require Django, but it works great with django-test-extensions behind it!) Morelia lets

Django standards?

2010-02-04 Thread David Parker
Hey all, I'm working on my first real Django app. I've been tinkering with it since last June, but I actually get to use it now. So my question is about what's the Django standard for what I'm doing... It's a Bible application, and so far, I have a url pattern: urlpatterns = patterns('',

Re: Django bases blog solutions

2010-02-04 Thread Peter Herndon
On Feb 4, 2010, at 10:02 AM, Joel Stransky wrote: > Hi all, > I'm brand new to Django/Python but not software development. I just to say hi > and ask for your understanding on my newbish questions. > I realize Django, when used correctly makes it stupidly easy to create > webblogs but I'm

FieldError with get_object_or_404

2010-02-04 Thread harryos
hi I was trying out in django's python shell the get_object_or_404 method on a set of entries I created in the db.I created an entry with a DateTimeField called 'posted_time'.I used datetime.datetime.now as default value and it created Date:2010-02-01 Time:10:02:22 I also created many other such

Re: Unicode/ASCII problems

2010-02-04 Thread David De La Harpe Golden
On 04/02/10 14:46, bruno desthuilliers wrote: On Feb 4, 9:18 am, Nohinder wrote: Hello, i ran into this problem too, the solution was to specify the page coding from the very begining: " # -*- coding: latin-1 -*-" This is for .py files, not templates. well, just to

Re: SQL statement runs in a loop

2010-02-04 Thread äL
On 4 Feb., 11:48, Daniel Roseman wrote: > On Feb 4, 6:23 am, äL wrote: > > > I have an SQL statement in views.py: > > > karatekas = Karateka.objects.extra(where = ["bsc = 1 OR skr = > > 1"]).select_related() > > > This statement runs in a loop

Re: kss with django

2010-02-04 Thread Shawn Milochik
> > Does somebody know which AJAX is the best for Django - jQuery, JSON or > something similar (KSS not any more?). > So I can search for instructions. > > Best regards > Ogi Neither jQuery nor JSON are AJAX. JSON is JavaScript Object notation -- the object type in JavaScript. If you're doing

Re: kss with django

2010-02-04 Thread Jorge Bastida
Take a look to http://dajaxproject.com/ Hope this helps you 2010/2/4 Vranesic Ogi > Am Donnerstag 04 Februar 2010 15:39:21 schrieb bruno desthuilliers: > > On Feb 4, 10:32 am, ogi wrote: > > > Hi > > > > > > I'm new in Django but rather old in Python. > > > I

Re: Editing a model in console: form validation fails

2010-02-04 Thread pjmorse
On Feb 3, 2:10 pm, Daniel Roseman wrote: > On Feb 3, 5:45 pm, pjmorse wrote: > > I narrowed the problem down to form validation in the view, and using > > pdb and some debug logging commands I got the validation errors out. > > Here's the

Re: kss with django

2010-02-04 Thread Vranesic Ogi
Am Donnerstag 04 Februar 2010 15:39:21 schrieb bruno desthuilliers: > On Feb 4, 10:32 am, ogi wrote: > > Hi > > > > I'm new in Django but rather old in Python. > > I followed the tutorialhttp://code.djangoproject.com/wiki/KSSInDjango > > to integrate KSS with Django and installed

Django bases blog solutions

2010-02-04 Thread Joel Stransky
Hi all, I'm brand new to Django/Python but not software development. I just to say hi and ask for your understanding on my newbish questions. I realize Django, when used correctly makes it stupidly easy to create webblogs but I'm curious as to whats out there as far as django based blog installs

Re: Unicode/ASCII problems

2010-02-04 Thread bruno desthuilliers
On Feb 4, 9:18 am, Nohinder wrote: > Hello, > i ran into this problem too, the solution was to specify the page coding > from the very begining: > " # -*- coding: latin-1 -*- " This is for .py files, not templates. > this is my first line in a .py file where i have/deal

Re: Problem with apache server

2010-02-04 Thread Alex Robbins
If you are in development, you can just use django dev server. "./ manage.py runserver" from your project. If you have deployed your app, then the best way to avoid restarting is to use mod_wsgi's reloading feature. If you deploy in daemon mode, you can just touch the wsgi file to trigger a

Re: kss with django

2010-02-04 Thread bruno desthuilliers
On Feb 4, 10:32 am, ogi wrote: > Hi > > I'm new in Django but rather old in Python. > I followed the tutorialhttp://code.djangoproject.com/wiki/KSSInDjango > to integrate KSS with Django and installed kss.django > did all settings. > But in views.py after > commands =

Re: Wp-super-cache clone for django

2010-02-04 Thread Alessandro Ronchi
On Sun, Jan 3, 2010 at 2:22 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > In wordpress there is a plugin that caches in a file (gzipped) a page > and returns it instead of recalculate all from database, directly from > apache. > A garbage collector removes cached pages older than

Re: Any way to make get_or_create() to create an object without saving it to database?

2010-02-04 Thread Tom Evans
On Wed, Feb 3, 2010 at 9:44 PM, wrote: > I have a similar problem. In my database is a result class. > You need an exam, a user and the points to create a result and points are > without null-values. > Now I want to use Result.objects.get_or_create(exam=e,user=u) to

Re: Using variable in place of field name in Django query .filter()

2010-02-04 Thread davidchambers
D'oh! I must have clicked "reply to author" (I'm so used to hitting "reply to all" in Gmail). I discovered a post which gives an example of Itay's suggestion in action: http://yuji.wordpress.com/2009/09/12/django-python-dynamically-create-queries-from-a-string-and-the-or-operator/. I also found

Re: Using variable in place of field name in Django query .filter()

2010-02-04 Thread Itay Donenhirsch
i don't see any way for a python function to _require_ a parameter to be hardcoded. i would be VERY surprised otherwise. this must work... i agree about python being designed awesomely though! :) On Thu, Feb 4, 2010 at 3:13 PM, davidchambers wrote: > Thanks for the

Re: Using variable in place of field name in Django query .filter()

2010-02-04 Thread Karen Tracey
On Thu, Feb 4, 2010 at 8:13 AM, davidchambers wrote: > Thanks for the suggestion. Unless I'm mistaken, though, using a > dictionary does not solve the problem which is that .filter() seems to > require field names to be hard-coded. Django is incredibly well >

Re: Using variable in place of field name in Django query .filter()

2010-02-04 Thread davidchambers
Thanks for the suggestion. Unless I'm mistaken, though, using a dictionary does not solve the problem which is that .filter() seems to require field names to be hard-coded. Django is incredibly well designed, though, and continually surprises me, so I'm almost _expecting_ to be pleasantly

Re: django and ldap

2010-02-04 Thread David De La Harpe Golden
On 04/02/10 08:33, andreas schmid wrote: @brad: can you show me some sample code for this? @david: i tried different configuration options but with no luck, i can bind and search manually over python-ldap so i can definitely connect. There are logging calls liberally sprinkled through the

Re: You're seeing this error because you have DEBUG = True in your Django settings file.

2010-02-04 Thread Emily Rodgers
On Feb 4, 3:54 am, punwaicheung wrote: > Page not found (404) > Request Method: GET > Request URL:http://www.cadal.zju.edu.cn/djvu_ulib/16003525/0001.djvu > > Using the URLconf defined in cadal.urls, Django tried these URL > patterns, in this order: > > ^personal/?$

Re: Using variable in place of field name in Django query .filter()

2010-02-04 Thread Itay Donenhirsch
i guess you can do it with a dictionary, i'll give you a general example: def foo(x,y,z): print "x=" + x print "y=" + y print "z=" + z d = { 'x' : 1, 'y': 2, 'z' : 3 } foo( **d ) # same as foo( x=1, y=2, z=3 ) it's a python thing, not django necessarily On Thu, Feb 4, 2010 at 1:20 PM,

Using variable in place of field name in Django query .filter()

2010-02-04 Thread davidchambers
I'm familiar with hard-coding filters in the standard fashion, e.g. posts = Post.objects.filter(title__contains='django'). I'm interested in finding out whether it's possible to replace title__contains in the above example with a variable. Why do I want to do this? Well, here's some pseudocode:

kss with django

2010-02-04 Thread ogi
Hi I'm new in Django but rather old in Python. I followed the tutorial http://code.djangoproject.com/wiki/KSSInDjango to integrate KSS with Django and installed kss.django did all settings. But in views.py after commands = KSSCommands() commands.core.replace... I got attribute error 'core' Any

Re: SQL statement runs in a loop

2010-02-04 Thread Daniel Roseman
On Feb 4, 6:23 am, äL wrote: > I have an SQL statement in views.py: > > karatekas = Karateka.objects.extra(where = ["bsc = 1 OR skr = > 1"]).select_related() > > This statement runs in a loop an no data will come back. > > If I change the little word "OR" to "AND", > >

Re: django-app user clashes with python-module user

2010-02-04 Thread Mike Ramirez
On Thursday 04 February 2010 01:17:46 patrickk wrote: > our hosting-provide told me that I should rename my django-app "user" > to something else, because there´s a python-module "user" and with > using user.urls (within our url configuration), we do get an error. > my question is, if this is the

django-app user clashes with python-module user

2010-02-04 Thread patrickk
our hosting-provide told me that I should rename my django-app "user" to something else, because there´s a python-module "user" and with using user.urls (within our url configuration), we do get an error. my question is, if this is the correct way to solve this problem. so far, I´ve never noticed

Re: django and ldap

2010-02-04 Thread andreas schmid
@brad: can you show me some sample code for this? @david: i tried different configuration options but with no luck, i can bind and search manually over python-ldap so i can definitely connect. ive seen that the requirements for django-auth-ldap are python2.3 and django1.0 so maybe thats one of

Re: Unicode/ASCII problems

2010-02-04 Thread Nohinder
Hello, i ran into this problem too, the solution was to specify the page coding from the very begining: " # -*- coding: latin-1 -*- " this is my first line in a .py file where i have/deal with special chars. it latin-1 does not work, try utf-8, although it should work Good Luck Karen Tracey-2