Re: List a model fields

2008-12-15 Thread Daniel Roseman

On Dec 16, 6:53 am, JF Simon  wrote:
> Hello, i'm new with python (and french so my english may seem very
> poor, sorry about that).
> I would like to list a model's fields and return a dict, here is the
> example :
>
> I have a model class with :
>
> meta_title : CharField(...)
> meta_description : CharField(...)
> body_header_title : CharField(...)
> body_header_text : CharField(...)
> foot : CharField(...)
>
> This class represents context for a page. This class will have a
> function get_context() who will return :
>
> {
>    meta :
>    {
>       title : 'value of meta_title' ,
>       text : 'value of meta_text' ,
>    } ,
>    body :
>    {
>       header :
>       {
>          title : 'value of body_header_title ,
>          text : 'value of body_header_text ,
>       }
>    } ,
>    foot : 'value of foot'
>
> }
>
> So i would like to :
>
> 1. get the list of my class's fields attributes
> 2. parse their names to obtain the dict
>
> Thanks a lot to the ones who read this message to the bottom !!
> Long live the Django project !!!


Look in the _meta inner class of your model - the fields property is
probably what you want. Something like:
dict((f.name, f) for f in mymodel._meta.fields)
should do the trick.
--
DR.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: logout_then_login - how to alter login_url

2008-12-15 Thread redbaron


> However, if you want to pass some extra information to the
> logout_then_login function, look at the third argument in the url() call
> -- the dictionary of extra parameters. You can set up the login_url
> parameter there.

hardcoding login_url is not the way I prefer to go. I supposed there
is some solution to pass login_url dynamically, but it's impossible as
I can see.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



List a model fields

2008-12-15 Thread JF Simon

Hello, i'm new with python (and french so my english may seem very
poor, sorry about that).
I would like to list a model's fields and return a dict, here is the
example :

I have a model class with :

meta_title : CharField(...)
meta_description : CharField(...)
body_header_title : CharField(...)
body_header_text : CharField(...)
foot : CharField(...)

This class represents context for a page. This class will have a
function get_context() who will return :

{
   meta :
   {
  title : 'value of meta_title' ,
  text : 'value of meta_text' ,
   } ,
   body :
   {
  header :
  {
 title : 'value of body_header_title ,
 text : 'value of body_header_text ,
  }
   } ,
   foot : 'value of foot'
}

So i would like to :

1. get the list of my class's fields attributes
2. parse their names to obtain the dict

Thanks a lot to the ones who read this message to the bottom !!
Long live the Django project !!!
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem in loading images.

2008-12-15 Thread Sura

Thank u so much for making me to take the right path...
Actually i got a mistake in the urls.py where i missed to remove a
'/'...
Also i have one more doubt.
Now the entire site url is under the control of django project
urls.py..
But how can i install other applications like joomla where i need to
get the path of the application ..
Can anyone plz help me to fix this problem of installing joomla in our
site whose url in completely under the control of django

On Dec 14, 1:27 am, Daniel Roseman 
wrote:
> On Dec 13, 7:37 pm,Sura wrote:
>
> > Hi djangonauts,
> > I am new to django and i developed the site using django.
> > My site works well in my system local server ..
> > I hosted my site in dreamhost server and the url iswww.csmit.org
> > But now in the site the images fail to load as well as the media..
> > But i can access from the pathwww.csmit.org/media/soi think there
> > is no problem for server to load the file to the browser.
> > But still the problem exist within the server.
> > I think i have made the proper settings in settings.py and url.py :)
> > Can anyone help this amateur to get out this difficulty soon..
>
> Sigh.http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#id1
>
> --
> DR.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Accessing Multiple Databases.

2008-12-15 Thread Malcolm Tredinnick


On Tue, 2008-12-16 at 14:28 +1100, Malcolm Tredinnick wrote:
> 
> On Tue, 2008-12-16 at 15:25 +1300, Tom Eastman wrote:
> > Hey Guys,
> > 
> > I'm about to start developing a web front-end for a large database being 
> > developed by a colleague.  The web front-end is only going to be 
> > accessing a sub-set of the database, and mostly via 'views' that will be 
> > specific to the requirements of the web frontend.
> > 
> > I want to use Django, since I'm vaguely familiar with it (and it rocks). 
> > But what I want to do is have one database for all the django-specific 
> > stuff, so that I don't have to create any django-specific tables in the 
> > main database.
> > 
> > Can anyone point me in the direction of achieving this?  Will I still be 
> > able to take advantage of Django's database API or will I end up having 
> > to drop to raw SQL a lot more?
> 
> You'll probably want to set things up so that the "natural" database is
> your Django-specific one and then accesses to the other database is done
> via a custom manager.

In hindsight, I probably wasn't clear as to why I'm suggesting this:
there are a lot of places where Django would like to write to your
database (sessions, auth lookups, ...). You can configure around and
away from each of those in turn, but, if this were me, I'd save on brain
wear-and-tear by letting Django behave normally until and unless I
wanted to talk to this other read-only database and then I'd explicitly
point my database connection in that direction. I have no stronger
technical reason for my suggestion than that; it's primarily intuition
and gut-feeling, but you don't have to tell anybody that.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Accessing Multiple Databases.

2008-12-15 Thread Malcolm Tredinnick


On Tue, 2008-12-16 at 15:25 +1300, Tom Eastman wrote:
> Hey Guys,
> 
> I'm about to start developing a web front-end for a large database being 
> developed by a colleague.  The web front-end is only going to be 
> accessing a sub-set of the database, and mostly via 'views' that will be 
> specific to the requirements of the web frontend.
> 
> I want to use Django, since I'm vaguely familiar with it (and it rocks). 
> But what I want to do is have one database for all the django-specific 
> stuff, so that I don't have to create any django-specific tables in the 
> main database.
> 
> Can anyone point me in the direction of achieving this?  Will I still be 
> able to take advantage of Django's database API or will I end up having 
> to drop to raw SQL a lot more?

You'll probably want to set things up so that the "natural" database is
your Django-specific one and then accesses to the other database is done
via a custom manager.

There are a few blog posts around about accessing multiple databases in
ways that work reliably, until such time as Django ships with it by
default. I'll just point you to this one, since I had the link to hand: 
http://www.mechanicalgirl.com/view/multiple-database-connection-a-simple-use-case/

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: login problem

2008-12-15 Thread vierda

Hi Matias,

Thanks for your reply but I did'nt get your point. sorry I'm newbie
and still learning.
I modified my_view function in my views as your suggestion (if I
didn't wrong get your point) as per below:

def my_view(request):
   if request.method == "POST" :
  username = request.POST['username']
  password = request.POST['password']
  user =  authenticate(username=username, password=password)
  render_to_response ('login.html', {'username': username,
'password' : password})

  if user is not None:
 if user.is_active:
login(request,user)
return render_to_response('success.html',
{'username':username})
 else:
return HttpResponse('disabled account')
  else:
 return HttpResponse('invalid login')
   else:
  return HttpResponse ('home page')

above code run and shows home page text, I assume that the method is
not POST regarding the result.
What sholud I do to fix this and show my login page. somebody please
help me to understand this concept. Thank you

regards,
-Mila-



On Dec 15, 9:06 am, Matias  wrote:
> Hello,
>
> You should check by which method was called your view.
> something like
>
> if request.method == "POST":
>     #now you can use request.POST
> else:
>     #just show the template
>
> Hope that helps,
>
> Matias.
>
>
>
> On Mon, Dec 15, 2008 at 5:15 AM, vierda  wrote:
>
> > Dear Ronny/all,
>
> > Thank you for your reply. I have modified my code and the error still
> > occur.
> > my new code as following below:
>
> > def my_view(request):
> >   username = request.POST['username']
> >   password = request.POST['password']
> >   user =  authenticate(username=username, password=password)#create
> > Authentication object
> >    render_to_response ('login.html', {'username': username,
> > 'password' : password})
>
> >   if user is not None:
> >      if user.is_active:
> >         login(request,user)
> >          return render_to_response('success.html',
> > {'username':username})
> >      else:
> >         return HttpResponse('disabled account')
> >    else:
> >      return HttpResponse('invalid login')
>
> > and my login.html as per below:
> > 
>
> > Enter Username: 
> > Enter Password: 
> > 
> > 
>
> > my success.html as per below :
> > 
> >  welcome{{username}}
> > 
>
> > somebody kindly help and thank you in advance
>
> > On Dec 6, 12:05 am, "Ronny Haryanto"  wrote:
> > > On Sat, Dec 6, 2008 at 2:42 PM, vierda  wrote:
> > > > today I try to make login page with follow example code in
> > > > djangoproject (user authentication chapter), code as following below :
>
> > > > def my_view(request):
> > > >   username = request.POST['username']
> > > >   password = request.POST['password']
> > > >   user =  authenticate(username=username, password=password)#create
> > > > Authentication object
>
> > > >   if user is not None:
> > > >      if user.is_active:
> > > >         login(request,user)
> > > >         return HttpResponse('login success')
> > > >      else:
> > > >         return HttpResponse('disable account')
> > > >   else:
> > > >      return HttpResponse('invalid login')
>
> > > > the above code always shows MultiValueDictKeyError with exception
> > > > value "Key 'username' not found in ".
>
> > > That exception will always be raised if the view is called via GET
> > > method instead of POST.
>
> > > If you're sending it via POST, then the information you provided was
> > > not sufficient. We need to see template code that renders the form (or
> > > the html form if you're not using templates) and probably the form as
> > > well.
>
> > > Ronny
>
> --
> :wq
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Sort Table Headers after data has been rendered via a POST request

2008-12-15 Thread SnappyDjangoUser

I wanted to run this by the group one more time does anyone know
how to handle sorting results by table header URL after a POST
request?

I have used the SortHeaders class for GET requests and it works
great.  I am hoping to find a way to extend this for POST requests.

Thanks!

On Nov 25, 2:29 pm, SnappyDjangoUser  wrote:
> I am hoping someone from this list may have some ideas on a solution
> to a problem I am facing...
>
> I am using aSortHeadersclass to perform ascending and descending
> filtering on table column headers.  (TheSortHeadersis found on
> Django Snippets,http://www.djangosnippets.org/snippets/308/, and
> works well!)  This works great when performing simple queries based on
> GET parameters.
>
> My Question: how to implement the same table header sorting after 
> aPOSTrequest?
>
> In my case I am submitting a form to search for items and then
> rendered the queried data with table headers which are intended for
> clickable sorting.  The problem is that when I click on the table
> headers the data is sent as a GET request and thus thePOSTquery
> never takes place.  Any suggestions on solutions?
>
> The only idea I have is create a form around the column headers with
> the search filters embedded as hidden inputs.  Then when a user sorts
> the table columns by clicking on a column header, the same search
> request would be submitted and the data would be ordered by the
> desired column.  My biggest problem with this approach is that I can't
> get the data to be submitted as apostrequest it always seems to
> be submitted as a GET request.
>
> Hopefully all of this makes sense... if not, let me know and I'll shed
> some light with examples.

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Accessing Multiple Databases.

2008-12-15 Thread Tom Eastman

Hey Guys,

I'm about to start developing a web front-end for a large database being 
developed by a colleague.  The web front-end is only going to be 
accessing a sub-set of the database, and mostly via 'views' that will be 
specific to the requirements of the web frontend.

I want to use Django, since I'm vaguely familiar with it (and it rocks). 
But what I want to do is have one database for all the django-specific 
stuff, so that I don't have to create any django-specific tables in the 
main database.

Can anyone point me in the direction of achieving this?  Will I still be 
able to take advantage of Django's database API or will I end up having 
to drop to raw SQL a lot more?

I'm just kind of testing the waters at the moment.  Anyone have any 
experience in similar situations?

Thanks!!

 Tom


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Accessing Multiple Databases

2008-12-15 Thread Tom Eastman

Hey Guys,

I'm about to start developing a web front-end for a large database being 
developed by a colleague.  The web front-end is only going to be 
accessing a sub-set of the database, and mostly via 'views' that will be 
specific to the requirements of the web frontend.

I want to use Django, since I'm vaguely familiar with it (and it rocks). 
But what I want to do is have one database for all the django-specific 
stuff, so that I don't have to create any django-specific tables in the 
main database.

Can anyone point me in the direction of achieving this?  Will I still be 
able to take advantage of Django's database API or will I end up having 
to drop to raw SQL a lot more?

I'm just kind of testing the waters at the moment.  Anyone have any 
experience in similar situations?

Thanks!!

 Tom


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: logout_then_login - how to alter login_url

2008-12-15 Thread Malcolm Tredinnick


On Mon, 2008-12-15 at 14:37 -0800, redbaron wrote:
> quote from official docs about logout_then_login view: "login_url: The
> URL of the login page to redirect to. This will default to
> settings.LOGIN_URL if not supplied"
> How to supply alternative login_url?

If you look at the function signature for logout_then_login(), in
django/contrib/auth/views.py, you'll see that it accepts a login_url
parameter.

> 
> I add logout url to urls.py:
>  url(r'^accounts/logout/
> $','django.contrib.auth.views.logout_then_login',name='logout'),
> 
> Then I'd like to redirect user to my custom page after logout succeed,
> how could I do that?
> {% url logout login_url="/my/custom/path" %} doesn't do the job, I
> catch error in reverse function.

The parameters passed via the "url" template tag are parameters that are
captured by the regular expression for that URL pattern. Your pattern,
in this case, is "accounts/logout/", which has no variable pieces --
that is, the reg-ex has no capturing groups. That's a good thing, since
it's not really something the user is ever going to control -- there's
precisely one way to logout.

However, if you want to pass some extra information to the
logout_then_login function, look at the third argument in the url() call
-- the dictionary of extra parameters. You can set up the login_url
parameter there.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Malcolm Tredinnick


On Mon, 2008-12-15 at 10:01 -0800, Jeff Kowalczyk wrote:
> On Dec 13, 9:31 pm, Malcolm Tredinnick 
> wrote:
> > That sounds like the only way. If you want to see batchadmin's changes,
> > you have to extend from that.
> 
> Thank you, I have made batchadmin find its media in my development
> setup.
> 
> My change_list.html, which now extends batchadmin/change_list.html, is
> not
> selected for rendering/has no effect in the filesystem layout I would
> expect to
> work, and recursion error problems in next most likely layout.
> 
> The following layout results in a recursion error:

Seriously. :-(

The remainder of your message is almost 400 lines long. That's in
addition to me having to know about batchadmin, which I have no
knowledge of. I'm all for helping out on mailing lists, but there is a
limit to the charity!

So let's fall back to first principles: always construct the smallest
case possible that repeats the failure. This means start with a template
that includes nothing but the "extends" of the batchadmin template. If
that works, you can start adding in the other lines until things stop
working and then back up a step to work out the problem that arises. If
the single line template does not work, you have a one-line template
that you can start debugging. It is *much* simpler.

Good luck,
Malcolm


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django newbie observation

2008-12-15 Thread Ariel Mauricio Nunez Gomez
I think pinax basic_site is pretty much what you want/need for a
sample_website.
I would be +1 for a link to Pinax project at the end of the tutorials.

Ayayalar:
pinax-0.5.0.tar.gz 
Once the download is complete, uncompress it and you should be able to cd
intoprojects/complete_project/ or projects/basic_project/ and run
./manage.py syncdband ./manage.py runserver to get running immediately.

Should you need more information, checkout:
http://pinaxproject.com/docs/trunk/install.html

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread Malcolm Tredinnick


On Mon, 2008-12-15 at 06:22 -0800, coulix wrote:
> Hello Djangonauts,
> I have a custom widget to create a kind of group list which ommits the
> last "/" at the end of an input field.
> Making html validation to fail.
> 
> The important code is here:
> 
>rendered_cb = cb.render(name, option_value)
> print rendered_cb
> output.append(u'%s %s' % (
> option_label,
> rendered_cb,
> option_label)
> )
> ...
>return mark_safe(u'\n'.join(output))
> 
> The shell output gives me
>  name="competences" />
>  >
> 
>  >
> 
> 
> Thats all good
> 
> But then HTML output after mark_safe takes this input "/" away

This seems to be an enormously large assumption. How have you worked out
that mark_safe() is doing this? A quick glance at the relevant pieces of
source (mark_safe() and the SafeUnicode class) will show it doesn't care
one wit about a slash character.

> Langues
>  name="competences" type="checkbox"> Anglais
> 
>  value="3" name="competences" type="checkbox"> Espagnol
>  value="4" name="competences" type="checkbox"> Japonais

The shell output you show doesn't look at all like the final output you
show, so it's not from the same run. I'm cautious about comparing apples
to oranges here. Since you print "rendered_cb" in the above code
fragment, that would be the relevant output to be comparing. Does it
have a trailing slash?

In short, there's information missing here. mark_safe() isn't doing
anything special that would affect this, as far as I know. I think you
need to take a few steps back and compare the output at each stage.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: RHEL 5.2 + mysql + Django 1.0 => Django 0.95.4

2008-12-15 Thread Malcolm Tredinnick


On Mon, 2008-12-15 at 11:40 +, Rachel Willmer wrote:
> Thanks for the reply.
> 
> Unfortunately the egg gives me the same problems as when I attempt an
> install from the tarball.
> 
> Any RHEL users out there encountered this problem and fixed it?

Whilst I use similar vintage RHEL boxes with at least one client, I
don't use MySQL on them, so this hasn't been an issue for me.

However, there's a larger issue at play here and, if you've got support
for RHEL, you should consider bringing it up with Red Hat: the reason
Django does not allow 1.2.1 prior to p2 is that it has a very serious
threading bug that causes crashes. Django managed to hit that bug and
there are details in our Trac if you, or somebody looking at that,
wanted to spend time searching amongst older closed tickets. *Nothing*
should be using it unless the mysql-python package been specifically
patched to work around that. You should check to see if it has been
patched by the vendor (RH) to avoid that problem. In an unpatched state,
it's simply a broken package containing a showstopper bug.

If it has been patched you *might* be able to just remove the version
check in the mysql backend of Django and things might just work (run
Django's test suite to check). To maintain version compatibility, Red
Hat often don't change the reported version number when they do
backpatch a package, which isn't unreasonable, but it does mean
something doing version checking (which is the most practical solution
for the other 97%) is going to raise a false negative. It's been a while
since I dived into the internals, but, from memory, 1.2.1 was more or
less identical, internally, as far as the API went, to 1.2.1p2 and we
don't do anything beyond using the public API.

Aside from that, you're just in the "normal" situation here with
long-lifetime, stable systems. Software that is younger than the
packaging date of your system version sometimes depends on more recent
versions, which themselves depend on more recent versions, etc. Django
does a pretty good job of being flexible and accommodating with respect
to maintaining older support, and even we have to draw the line
somewhere (we spent 18 months, and a lot of care, phasing out support
for MySQL-python < 1.2.1p2, in order not to disrupt too many
situations). A lot of other releases aren't willing, or possibly able,
to be that gentle.

Finally, it's not clear what you meant when you wrote "other file
versioning problems". If you can get the wrapper to compile (it should
only need the mysql-client libraries to build against and anything back
to late MySQL 3.x works with mysql-python, again, from memory), then you
can install it locally somewhere and set your Python path to pick up
your local copy before the system one. It sounds like you're trying to
upgrade the system-installed rpm, which is usually not a great idea on a
system like that (not just because it usually invalidates support
contracts, but because it makes future maintenance harder). Local
installs are preferred.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
Yes, this was fixed post 1.0 release.  If you upgrade to 1.0.2 it may fix
your problem.

Craig

On Mon, Dec 15, 2008 at 4:04 PM, jmat  wrote:

>
> I'm using 1.0
>
> Is the patch post 1.0 ?  I was having a tough time figuring out if
> that patch was post 1.0 or not on the ticket (I'm probably blind ;)
>
> APPEND_SLASH is not modified (so it is default True)
>
> I changed PREPEND_WWW to True but it did not seem to have any
> effect...
>
> I can try the patch if it is a post 1.0 ... haven't had time to go
> chase into the django code to compare.
>
> - JM
>
> On Dec 15, 11:37 am, "Craig Kimerer"  wrote:
> > Which version of Django are you using?  Do you also have APPEND_SLASH set
> to
> > true?  There was a ticket about this a while back that was fixed (
> http://code.djangoproject.com/ticket/9199).
> >
> > Hope that helps.
> >
> > Craig
> >
> > On Mon, Dec 15, 2008 at 11:23 AM, jmat  wrote:
> >
> > > Just curious, has anyone else ever set this to true and not had it
> > > work?
> >
> > > On Dec 14, 4:05 pm, jmat  wrote:
> > > > I set this to true in my settings file but It doesn't seem to be
> > > > getting picked up.
> >
> > > > Does this still have issues with some middleware or am I seeing some
> > > > kind of settings reload or cache issue?
> >
>

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread jmat

I'm using 1.0

Is the patch post 1.0 ?  I was having a tough time figuring out if
that patch was post 1.0 or not on the ticket (I'm probably blind ;)

APPEND_SLASH is not modified (so it is default True)

I changed PREPEND_WWW to True but it did not seem to have any
effect...

I can try the patch if it is a post 1.0 ... haven't had time to go
chase into the django code to compare.

- JM

On Dec 15, 11:37 am, "Craig Kimerer"  wrote:
> Which version of Django are you using?  Do you also have APPEND_SLASH set to
> true?  There was a ticket about this a while back that was fixed 
> (http://code.djangoproject.com/ticket/9199).
>
> Hope that helps.
>
> Craig
>
> On Mon, Dec 15, 2008 at 11:23 AM, jmat  wrote:
>
> > Just curious, has anyone else ever set this to true and not had it
> > work?
>
> > On Dec 14, 4:05 pm, jmat  wrote:
> > > I set this to true in my settings file but It doesn't seem to be
> > > getting picked up.
>
> > > Does this still have issues with some middleware or am I seeing some
> > > kind of settings reload or cache issue?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



HTTPS and URL form field validation

2008-12-15 Thread Nick

Hello,

My Django 1.0 project is installed on two different servers (one is
development, the other staging, both running Red Hat Linux). The main
page has a form with a URL field, and I'm using the built in Django
field validation, which determines whether the URL is valid by seeing
if it's reachable. My problem involves HTTPS URLs. (Plain old HTTP
URLS work fine on both servers.)

On the development server, an HTTPS URL validates just fine. On the
staging server, with the same URL, Django returns an error, saying
"This URL appears to be a broken link."

Using other facilities on the staging server, such as wget, I am able
to reach the HTTPS URL.

At first we discovered that the staging server was running Python
2.5.2 that had been installed without SSL support. However,
reinstalling with SSL support did not fix the problem. I believe the
system administrator also rebuilt mod_python.

Any ideas on what could be going on?

Thanks.

Nick

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



logout_then_login - how to alter login_url

2008-12-15 Thread redbaron

quote from official docs about logout_then_login view: "login_url: The
URL of the login page to redirect to. This will default to
settings.LOGIN_URL if not supplied"
How to supply alternative login_url?

I add logout url to urls.py:
 url(r'^accounts/logout/
$','django.contrib.auth.views.logout_then_login',name='logout'),

Then I'd like to redirect user to my custom page after logout succeed,
how could I do that?
{% url logout login_url="/my/custom/path" %} doesn't do the job, I
catch error in reverse function.

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Beginners questions on forms containing multiple related model types.

2008-12-15 Thread Brian

Hi,

I'm new to django and have been working hard to find "the right way"
or at least "a good way" to do things.  I'm running into a few
problems though that I can't get answers for.

The following post describes my situation very clearly.  It may be
long-winded but hopefully it's unambiguous.  I'm sure there'll be
nothing difficult to the experienced django user here, but some
answers could be helpful to me and other beginners.

In my django model I have the following classes: Person and
BankAccount.  There are other model types too, but these should
suffice to illustrate my problem.

Person:
  person_id
  first_name
  surname

BankAccount:
  bank_account_id
  person_id (ForeignKey)
  bank_code
  account_number

A Person may have ZERO or ONE BankAccounts.
I want to be able to create or edit the details for a Person
(including their associated BankAccount, should it exist) on the one
html form.  I've created some ModelForm types to help with this:

class PersonForm(ModelForm):
class Meta:
model = Person

class BankAccountForm(ModelForm):
class Meta:
model = BankAccount
exclude = ('person',) #Avoid the dropdown menu

I've been advised (on IRC #django) that "create new" should be handled
at one URL and "edit existing" at a separate URL.  I handle the URLs
at different view functions.  So in url.py:
url(r'person/add/$', 'person_add', 'person_add'),
url(r'person/(?P\d+)/$', 'person_edit',
name='person_edit'),

The "person_add" view function is easy to implement.  For request.GET
for I simply create a new PersonForm and a new BankAccountForm and
expose them to the template via the context.  The request.POST is easy
too - however I only save the BankAccount data if non-blank data was
supplied.

The "person_edit" view function raises some problems though:
1) I may be editing a Person that has no associated BankAccount.  So
basically I'm supplying a form with "edit existing" functionality for
the Person model and "create new" functionality for the BankAccount.
This doesn't cause a problem in itself, but it does break the paradigm
of separating "create new" and "edit existing" functionality - if such
a paradigm is indeed correct.

2) When a GET request to /person/5/ is received, I retrieve the
relevant Person from the db.  In a separate db query I then have to
try to get an associated BankAccount.  If I do:
BankAccount.objects.get(person=person_id)
and the BankAccount doesn't exist a DoesNotExist exception is
thrown... This really surprised me.  Thinking about it from a db query
perspective I would have expected an empty list.  I notice however if
I do:
BankAccount.objects.filter(person=person_id)
I receive an empty list when there is no match.  I presume this is by
design, I just wonder what the logic of that design is.  Any ideas?

3) When a POST request to /person/5/ is received the URL tells me I'm
editing Person "5", but I also need to know if I'm editing or creating
a BankAccount too.  I can obviously query the BankAccount table for a
record matching person_id=5, but again there is a db roundtrip
overhead here.  Alternatively, I think I could have included a hidden
bank_account_id field when I received the GET request for /person/5/
so that upon POST I would "know" the bank_account_id - with some
security concerns though.  What is best-practice in this situation?

4) You might notice that the relationship between Person and
BankAccount is modelled as a One-To-Many, however my business logic
requires One-To-(Zero or One).  I wondered if I could use the
models.OneToOneField for this, but the documentation seemed to imply
that django would expect exactly one record on BOTH sides of
relationship, so it may not be suitable for the One-To-Zero case.
Again, if anyone has advice on what I should actually do here, please
let me know.

Obviously this is a simple example and I could code a solution that
would work.  However, my real problem involves several similar
relationships on the one form.  The POST handling code could get very
hairy if I don't do it well.

If you got this far, thanks for taking the time to read this.

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread Craig Kimerer
Which version of Django are you using?  Do you also have APPEND_SLASH set to
true?  There was a ticket about this a while back that was fixed (
http://code.djangoproject.com/ticket/9199).

Hope that helps.

Craig

On Mon, Dec 15, 2008 at 11:23 AM, jmat  wrote:

>
> Just curious, has anyone else ever set this to true and not had it
> work?
>
> On Dec 14, 4:05 pm, jmat  wrote:
> > I set this to true in my settings file but It doesn't seem to be
> > getting picked up.
> >
> > Does this still have issues with some middleware or am I seeing some
> > kind of settings reload or cache issue?
> >
>

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread jmat

Ok, thanks, I was curious if we use a .htaccess file to do the re-
writing with django, does the file live in the webroot or in the
django application root?

On Dec 15, 12:41 pm, Ross  wrote:
> @jmat I have never tried Django's PREPEND_WWW, but it can easily be
> handled by Apache. Some of the features involving URLs, paths, etc.
> are possibly better left to Apache.
>
> Apache has a rewrite guide that has all the information you should
> need. I found a good link a while ago with exactly what you are
> looking for, but my search skills are crummy today. Search for "apache
> force www", and you should find what you need.
>
> http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
>
> On Dec 15, 1:23 pm, jmat  wrote:
>
> > Just curious, has anyone else ever set this to true and not had it
> > work?
>
> > On Dec 14, 4:05 pm, jmat  wrote:
>
> > > I set this to true in my settings file but It doesn't seem to be
> > > getting picked up.
>
> > > Does this still have issues with some middleware or am I seeing some
> > > kind of settings reload or cache issue?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ModelAdmin list_filter presets: usability best practice?

2008-12-15 Thread Jeff Kowalczyk

Does anyone have a best-practice suggestion for ModelAdmins which are
best used with a preset list_filter? Put another way, where are the
best usability customization points so the user sees a specific list
filter when entering that modeladmin, and when being redirected after
various actions, but also seldom runs into an annoyance where they
have to 'unfilter' repeadedly to see the change_list they want at this
one point in time.

For example, I have a model where the appropriate list_filter
settings  are ?assigned_to__id__exact=(user_id)__exact=1

Thanks for any suggestions.

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Postgres Full-text search -- is it possible?

2008-12-15 Thread alex.gay...@gmail.com

It can be done using extra as shown here:
http://barryp.org/blog/entries/postgresql-full-text-search-django/
there isn't a way built into django
to do it however, there are also a few external search projects to
create a nicer search api in django.  This one: 
http://code.google.com/p/djangosearch/
specifically was worked on as a part of the google summer of code and
perhaps you could speak with them about a pg backend if they don't
have one already.

Alex

On Dec 15, 2:35 pm, Info Cascade  wrote:
> Hi --
>
> I'm wanting to improve searches by using full-text searching.  The
> documentation says:
>
> >         search¶
> >         
>
> > A boolean full-text search, taking advantage of full-text indexing.
> > This is like contains but is significantly faster due to full-text
> > indexing.
>
> > Note this is only available in MySQL and requires direct manipulation
> > of the database to add the full-text index.
>
> What options are available for Postgres if any?  Postgres has this
> capability, I believe. Can Django not use it?
>
> Liam
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django + mail server

2008-12-15 Thread Oliver Beattie

http://docs.djangoproject.com/en/dev/ref/settings/#email-host

On Dec 15, 7:25 pm, prem1er  wrote:
> Didn't know about this. Where do I set the EMAIL_HOST parameter?
>
> On Dec 15, 1:35 pm, "Karen Tracey"  wrote:
>
>
>
> > On Mon, Dec 15, 2008 at 1:01 PM, prem1er  wrote:
>
> > > Hey everyone,
> > >   I'm trying to create a registration page on my website using Django
> > > forms.  I just realized that I needed to install a mail server in
> > > order to send confirmation messages to my users through the forms.
> > > What type of setup is everyone using for this?  i.e. Postfix + mutt.
> > > Thanks in advance.
>
> > Why do you have to install a mail server?  Can you not simply set
> > EMAIL_HOST, etc. to point to an existing mail server that you have access to
> > and authority to send mail through?
>
> >http://docs.djangoproject.com/en/dev/topics/email/
>
> > Karen
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread Ross

@jmat I have never tried Django's PREPEND_WWW, but it can easily be
handled by Apache. Some of the features involving URLs, paths, etc.
are possibly better left to Apache.

Apache has a rewrite guide that has all the information you should
need. I found a good link a while ago with exactly what you are
looking for, but my search skills are crummy today. Search for "apache
force www", and you should find what you need.

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

On Dec 15, 1:23 pm, jmat  wrote:
> Just curious, has anyone else ever set this to true and not had it
> work?
>
> On Dec 14, 4:05 pm, jmat  wrote:
>
> > I set this to true in my settings file but It doesn't seem to be
> > getting picked up.
>
> > Does this still have issues with some middleware or am I seeing some
> > kind of settings reload or cache issue?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Postgres Full-text search -- is it possible?

2008-12-15 Thread Info Cascade
Hi --

I'm wanting to improve searches by using full-text searching.  The
documentation says:
>
>
> search¶
> 
>
> A boolean full-text search, taking advantage of full-text indexing.
> This is like contains but is significantly faster due to full-text
> indexing.
>
> Note this is only available in MySQL and requires direct manipulation
> of the database to add the full-text index.
>
What options are available for Postgres if any?  Postgres has this
capability, I believe. Can Django not use it?

Liam

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django + mail server

2008-12-15 Thread prem1er

Didn't know about this. Where do I set the EMAIL_HOST parameter?

On Dec 15, 1:35 pm, "Karen Tracey"  wrote:
> On Mon, Dec 15, 2008 at 1:01 PM, prem1er  wrote:
>
> > Hey everyone,
> >   I'm trying to create a registration page on my website using Django
> > forms.  I just realized that I needed to install a mail server in
> > order to send confirmation messages to my users through the forms.
> > What type of setup is everyone using for this?  i.e. Postfix + mutt.
> > Thanks in advance.
>
> Why do you have to install a mail server?  Can you not simply set
> EMAIL_HOST, etc. to point to an existing mail server that you have access to
> and authority to send mail through?
>
> http://docs.djangoproject.com/en/dev/topics/email/
>
> Karen
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PREPEND_WWW

2008-12-15 Thread jmat

Just curious, has anyone else ever set this to true and not had it
work?

On Dec 14, 4:05 pm, jmat  wrote:
> I set this to true in my settings file but It doesn't seem to be
> getting picked up.
>
> Does this still have issues with some middleware or am I seeing some
> kind of settings reload or cache issue?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where to I need to install the Python database bindings?

2008-12-15 Thread Samir van de Sand
Thank you for the answer Karen.
One other question: Does the db admin need to set any permissiona so that
Django can connect via oracle_cx to the database? (until now I always used
to connect over ODBC to the db)

On Mon, Dec 15, 2008 at 3:33 PM, Karen Tracey  wrote:

> On Mon, Dec 15, 2008 at 9:13 AM, Samir van de Sand <
> samir@googlemail.com> wrote:
>
>> Hello everyone,
>>
>> I know this is am embarrassing question but I have to ask: Given that
>> django is running on one machine and the database is running on another
>> machine, where do I have install the python database bindings? I presume on
>> the machine where django is running?
>>
>
> Yes, where Django is running.
>
> Karen
>
>
> >
>

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django + mail server

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 1:01 PM, prem1er  wrote:

>
> Hey everyone,
>   I'm trying to create a registration page on my website using Django
> forms.  I just realized that I needed to install a mail server in
> order to send confirmation messages to my users through the forms.
> What type of setup is everyone using for this?  i.e. Postfix + mutt.
> Thanks in advance.
>

Why do you have to install a mail server?  Can you not simply set
EMAIL_HOST, etc. to point to an existing mail server that you have access to
and authority to send mail through?

http://docs.djangoproject.com/en/dev/topics/email/

Karen

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Generating a slug from an m2m field

2008-12-15 Thread Delta20

In case anyone else is looking for a solution to this, here's the work-
around I came up with:

In the ModelAdmin class for Ticket, override the save_model function
and force the m2m relations to be saved. For example:


class TicketAdmin(admin.ModelAdmin):
model = Ticket

def save_model(self, request, obj, form, change):
super(TicketAdmin, self).save_model(request, obj, form,
change)
form.save_m2m()
obj.update_ticket_slug()

The drawback is that save_m2m gets called twice (the second time is in
the change_view function), but this is a small price to pay to get the
desired functionality. If anyone knows a better approach, I would
appreciate hearing about it.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan

fantastic that worked amazingly well. thank you

On Dec 15, 12:23 pm, Brian Neal  wrote:
> On Dec 15, 10:53 am, garagefan  wrote:> how would i 
> make the group include apache?
>
> Not sure what you are asking. I look in /etc/group to see what groups
> apache belongs to. On my system, apache belongs to a group called
> apache. So I did something like:
>
> # chgrp apache uploads
> # chmod 775 uploads
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 10:55 AM, Aldo  wrote:

>
> Still no good lars. Thanks though.
>

http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield

documents how to override the default valid date formats for input to a
DateField.

http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-default-field-types

describes how to override the default fields created by a ModelForm.  So I
think you want to override the field in your ModelForm and specify a
different list of valid date input formats.

Karen

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Jeff Kowalczyk

On Dec 13, 9:31 pm, Malcolm Tredinnick 
wrote:
> That sounds like the only way. If you want to see batchadmin's changes,
> you have to extend from that.

Thank you, I have made batchadmin find its media in my development
setup.

My change_list.html, which now extends batchadmin/change_list.html, is
not
selected for rendering/has no effect in the filesystem layout I would
expect to
work, and recursion error problems in next most likely layout.

The following layout results in a recursion error:

  $ tree /path/to/acme/acme/widgets/templates
  /path/to/acme/acme/widgets/templates
  |-- admin
  |   `-- widgets
  |   `-- widget
  |   `-- change_form.html
  |-- batchadmin
  |   `-- change_list.html
  `-- widgets
  |-- detail.html
  `-- index.html

Both layouts below have no effect on rendering the searchbar
customization, but
generate no recursion error:

  $ tree /path/to/acme/acme/widgets/templates
  /path/to/acme/acme/widgets/templates
  |-- admin
  |   `-- widgets
  |   `-- widget
  |   `-- change_form.html
  |-- batchadmin
  |   `-- widgets
  |   `-- widget
  |   `-- change_list.html
  `-- widgets
  |-- detail.html
  `-- index.html

  $ tree /path/to/acme/acme/widgets/templates
  /path/to/acme/acme/widgets/templates
  |-- admin
  |   `-- widgets
  |   `-- widget
  |   |-- change_form.html
  |   `-- change_list.html
  |-- batchadmin
  `-- widgets
  |-- detail.html
  `-- index.html

The last is the layout which works prior to the batchadmin and changes
to
extend batchadmin/change_list.html.


The following is the djang-batchadmin batchadmin/change_list template
extending
admin/change_list:

  $ cat /path/to/django-batchadmin/batchadmin/templates/batchadmin/
change_list.html

  {% extends "admin/change_list.html" %}

  {% load batch_list %}

  {% block extrahead %}{{ block.super }}{{ batchadmin_media }}{%
endblock %}

  {% block result_list %}
  
  {% if batchadmin_on_top or not cl.paginator.count %}{% actions %}
{% endif %}
  {{ block.super }}
  {% if batchadmin_on_bottom and cl.paginator.count %}{% actions %}
{% endif %}
  
  {% endblock %}


And per http://www.djangosnippets.org/snippets/1239/ and this thread,
the
widgets app custom change_list.html extends batchadmin/
change_list.html:

  $ cat /path/to/acme/acme/widgets/templates/admin/widgets/widget/
change_list.html

  {% extends "batchadmin/change_list.html" %}
  {% load adminmedia %}
  {% load i18n %}
  {% load admin_modify %}
  {% block extrahead %}{{ block.super }}
  
  
  {{ media }}

  
  jQuery.fn.counter = function() {
// setup initial counter display
$(this).each(function() {
  var max = $(this).attr('size');
  var val = $(this).attr('value');
  var cur = 0;
  if(val) // value="", or no value at all will cause an error
cur = val.length;
  var left = max-cur;
  $(this).after(""
+ left.toString()+" characters remaining");
  // Style as desired
  var c = $(this).next(".counter");
  c.css("margin-left","10px");
  c.css("padding", "0 3px 0 3px")
  c.css("border", "1px solid #ccc")
  if(left <= 10)
  c.css("background","#F4F379");
  else
  c.css("background","none");

  // setup counter to change with keystrokes
  $(this).keyup(function(i) {
var max = $(this).attr('size');
var val = $(this).attr('value');
var cur = 0;
if(val)
  cur = val.length;
var left = max-cur;
var c = $(this).next(".counter");
c.text(left.toString());
if(left <= 10)
c.css("background","#F4F379");
else
c.css("background","none");
return this;
  });
});
return this;
  }

  $(document).ready(function() {
$("#searchbar").counter();
  });

  //-->
  
  {% endblock %}
  {% block search %}
  {% if cl.search_fields %}
  
  
  
  
  
  {% if show_result_count %}
  {% blocktrans count cl.result_count as
counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %}
({% blocktrans with
cl.full_result_count as full_result_count %}{{ full_result_count }}
total{% endblocktrans %})
  {% endif %}
  {% for pair in cl.params.items %}
  {% ifnotequal pair.0 search_var %}{% endifnotequal %}
  {% endfor %}
  
  
  document.getElementById
("searchbar").focus();
  {% endif %}
  {% endblock %}

The above template works correctly before the addition of batchadmin
to the
setup below (and the change to extends). I've included a lot of setup
detail
below, not sure which may be relevant to the problem at hand:

Thanks for any suggestions.


Setup Details
-

I'm using a site_media to develop locally without any external http
server. The
setup will become more conventional when deployment is imminent.

  /path/to/acme/acme (master) $ python manage.py runserver

  Validating models...
  0 errors found

  Django 

Django + mail server

2008-12-15 Thread prem1er

Hey everyone,
   I'm trying to create a registration page on my website using Django
forms.  I just realized that I needed to install a mail server in
order to send confirmation messages to my users through the forms.
What type of setup is everyone using for this?  i.e. Postfix + mutt.
Thanks in advance.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: setting the proper file permisions chmod

2008-12-15 Thread Brian Neal

On Dec 15, 10:53 am, garagefan  wrote:
> how would i make the group include apache?
>
Not sure what you are asking. I look in /etc/group to see what groups
apache belongs to. On my system, apache belongs to a group called
apache. So I did something like:

# chgrp apache uploads
# chmod 775 uploads

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: login problem

2008-12-15 Thread Matias
Hello,

You should check by which method was called your view.
something like

if request.method == "POST":
#now you can use request.POST
else:
#just show the template


Hope that helps,

Matias.

On Mon, Dec 15, 2008 at 5:15 AM, vierda  wrote:

>
> Dear Ronny/all,
>
> Thank you for your reply. I have modified my code and the error still
> occur.
> my new code as following below:
>
> def my_view(request):
>   username = request.POST['username']
>   password = request.POST['password']
>   user =  authenticate(username=username, password=password)#create
> Authentication object
>render_to_response ('login.html', {'username': username,
> 'password' : password})
>
>   if user is not None:
>  if user.is_active:
> login(request,user)
>  return render_to_response('success.html',
> {'username':username})
>  else:
> return HttpResponse('disabled account')
>else:
>  return HttpResponse('invalid login')
>
> and my login.html as per below:
> 
>
> Enter Username: 
> Enter Password: 
> 
> 
>
> my success.html as per below :
> 
>  welcome{{username}}
> 
>
> somebody kindly help and thank you in advance
>
>
> On Dec 6, 12:05 am, "Ronny Haryanto"  wrote:
> > On Sat, Dec 6, 2008 at 2:42 PM, vierda  wrote:
> > > today I try to make login page with follow example code in
> > > djangoproject (user authentication chapter), code as following below :
> >
> > > def my_view(request):
> > >   username = request.POST['username']
> > >   password = request.POST['password']
> > >   user =  authenticate(username=username, password=password)#create
> > > Authentication object
> >
> > >   if user is not None:
> > >  if user.is_active:
> > > login(request,user)
> > > return HttpResponse('login success')
> > >  else:
> > > return HttpResponse('disable account')
> > >   else:
> > >  return HttpResponse('invalid login')
> >
> > > the above code always shows MultiValueDictKeyError with exception
> > > value "Key 'username' not found in ".
> >
> > That exception will always be raised if the view is called via GET
> > method instead of POST.
> >
> > If you're sending it via POST, then the information you provided was
> > not sufficient. We need to see template code that renders the form (or
> > the html form if you're not using templates) and probably the form as
> > well.
> >
> > Ronny
> >
>


-- 
:wq

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Model field order

2008-12-15 Thread bfrederi

Nevermind, I think I found my answer.

in the model._meta attribute, there is an attribute called fields
(model._meta.fields) that is a list of the fields in the model, in the
order in which you defined them.

On Dec 15, 10:24 am, bfrederi  wrote:
> If I've defined a model like so:
>
> class comment(models.Model):
>     name = models.CharField(max_length=25)
>     place = models.CharField(max_length=100, blank=True)
>     comment = models.TextField()
>
> How do I get the order I defined the model fields in, once I have the
> model object.
>
> For instance:
>
> model = models.get_model(app_label, model_name)
>
> I now have the model object, and I want to be able to get the correct
> order of the fields as I have defined them (name, place, and comment,
> in that order). Is there a method in django to get that ordering?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: SOAPpy and pyxml installation/usage

2008-12-15 Thread Matias
Try checking the specific exception and its message.

Matias.

2008/12/15 Steve 

>
> OK. I'm having second thoughts on suds. It seems to work great some
> times, but not so great on others. I have the following code, where
> vid is the wsdl of the video.
> Many of them fail. I got these wsdl's from http://www.xmethods.net and
> presumably they're good.
>
> def check(vid):
>   try:
>  client = Client(vid)
>  print "succeeded: " + vid
>   except:
>  print "failed: " + vid
>
> for x in wsdl:
>   check(x)
>
> It fails quite a bit, just to load the wsdl file. Here's the results:
> succeeded: http://ws2.fraudlabs.com/mailboxvalidator.asmx?wsdl
> succeeded: http://www.imcomponents.com/imsoap/?wsdl
> succeeded:
> http://coeservice.en.kku.ac.th:8080/TemperatureConvertor/TemperatureConvertorService?WSDL
> failed: http://ws.strikeiron.com/RealTimeNASDAQStockQuotes?WSDL
> failed: http://ws.strikeiron.com/RealTimeStockQuotes3?WSDL
> failed: http://ws.strikeiron.com/DelayedStockQuotes15min?WSDL
> failed:
> http://www.siprod.net/webservices/xemail/xemailwebservice.asmx?WSDL
> failed: https://api.postalmethods.com/PostalWS.asmx?WSDL
> succeeded: http://ws.fraudlabs.com/browserobjectwebservice.asmx?wsdl
> succeeded: http://ws.fraudlabs.com/areacodeworldwebservice.asmx?wsdl
> succeeded: http://ws.cdyne.com/ProfanityWS/Profanity.asmx?wsdl
> succeeded: http://euro2008.dataaccess.eu/footballpoolwebservice.wso?WSDL
> succeeded: http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl
> succeeded: http://www.ecubicle.net/whois_service.asmx?WSDL
>
> If anyone has any thoughts, I'm all ears. I'm going to try to post
> this on the suds page, see if they can't fix it.
>
> -Steve
>
> On Dec 12, 12:24 am, Jarek Zgoda  wrote:
> > Wiadomość napisana w dniu 2008-12-11, o godz. 09:31, przez Steve:
> >
> > > This may be a more of a generic Python question, but I'm working with
> > > Django so thought that I'd see if there's a Django specific solution
> > > to it.
> >
> > > I'm trying to work with SOAP. I'm new to it and a Jr. programmer as
> > > well. From Dive into Python it has this great example about how to
> > > handle SOAP calls.
> > >http://www.diveintopython.org/soap_web_services/index.html
> >
> > Drop SOAPpy and ZSI, they are not documented and nearly dead. Try suds.
> >
> > --
> > We read Knuth so you don't have to. - Tim Peters
> >
> > Jarek Zgoda, R, Redefine
> > jarek.zg...@redefine.pl
> >
>


-- 
:wq

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan

how would i make the group include apache?

On Dec 15, 11:32 am, Brian Neal  wrote:
> On Dec 15, 9:51 am, garagefan  wrote:
>
> > Just wondering if anyone else has experience with setting the write
> > permissions for apache using mod_python w/ django.
>
> Instead of 0777 I use 0775. I chgrp on the uploads directory, making
> the group be a group that includes the apache user.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: setting the proper file permisions chmod

2008-12-15 Thread Brian Neal

On Dec 15, 9:51 am, garagefan  wrote:
> Just wondering if anyone else has experience with setting the write
> permissions for apache using mod_python w/ django.
>

Instead of 0777 I use 0775. I chgrp on the uploads directory, making
the group be a group that includes the apache user.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Model field order

2008-12-15 Thread bfrederi

If I've defined a model like so:

class comment(models.Model):
name = models.CharField(max_length=25)
place = models.CharField(max_length=100, blank=True)
comment = models.TextField()

How do I get the order I defined the model fields in, once I have the
model object.

For instance:

model = models.get_model(app_label, model_name)

I now have the model object, and I want to be able to get the correct
order of the fields as I have defined them (name, place, and comment,
in that order). Is there a method in django to get that ordering?
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Still no good lars. Thanks though.

On Dec 15, 3:44 pm, Lars Stavholm  wrote:
> Aldo wrote:
> > Yes I have tried that but still nothing - thats what lead me to
> > looking at this!
>
> Try with "USE_I18N = False" in settings.py.
> Some sort of known issue, I do believe there's
> a ticket somewhere confirming this.
> /L
>
> > On Dec 15, 3:28 pm, Lars Stavholm  wrote:
> >> Aldo wrote:
> >>> I am using django forms. I have created a model/form with 2 fields,
> >>> name and date.
> >>> Prior to saving the form i check if the form is_valid?
> >>> if form.is_valid():
> >>>     form.save()
> >>> My problem is it wants the date in the format - MM/DD/
> >>> Otherwise it will not see the form as valid - and not save.
> >>> How can i change this I want the date in the format DD/MM/
> >> Maybe setting DATE_FORMAT in settings.py could help.
>
> >>http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-...
>
> >> /Lars
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: setting the proper file permisions chmod

2008-12-15 Thread garagefan

Just wondering if anyone else has experience with setting the write
permissions for apache using mod_python w/ django.

On Dec 11, 6:01 pm, Graham Dumpleton 
wrote:
> On Dec 12, 9:07 am,garagefan wrote:
>
> > which would actually result in keeping my server more secure... i
> > would assume leaving other with rwx would be paramount to keeping my
> > front door wide open?
>
> The risk is more from users who have shell accounts on the same
> system, or have web applications running as different user. Those
> users would be able to modify stuff in that directory even though they
> aren't owner.
>
> It doesn't change the risk in respect of other web application code
> running under mod_python or PHP which also runs as Apache user. Such
> code because runs as Apache user would be able to write to the
> directory even if owned by Apache user and not o+rwx.
>
> > I'll look into mod_wsgi... but i can't imagine that every person
> > running mod_python and working with file uploads hasn't had to combat
> > this little issue.
>
> Based on posts one sees, a lot of people just make it o+rwx and leave
> it at that.
>
> > is there really a safety concern?
>
> If you are fully in control of the system and no other users on it, it
> is not good, but not disastrous.
>
> > or is there another way around this?
>
> Make the user owned by Apache user instead and don't have o+rwx.
>
> I am biased, but arguable that mod_wsgi is a better overall choice
> these days than mod_python anyway and with mod_python fading away to a
> degree, better long term choice.
>
> Graham
>
> > On Dec 11, 4:59 pm, Graham Dumpleton 
> > wrote:
>
> > > On Dec 12, 8:52 am,garagefan wrote:
>
> > > > this is my first time working this closely to the server for a live
> > > > environment :)
>
> > > > "apache" appears as owner of the file once uploaded. is there a way to
> > > > set the default on this to be another user?
>
> > > Only by using Apache/mod_wsgi (not mod_python) and specifically using
> > > mod_wsgi daemon mode, with a distinct user defined for the daemon
> > > process and thus your Django application to run as.
>
> > > Graham
>
> > > > On Dec 11, 4:45 pm, Graham Dumpleton 
> > > > wrote:
>
> > > > > On Dec 12, 8:32 am,garagefan wrote:
>
> > > > > > I figured out my issue with the "access denied, suspicious 
> > > > > > operation"
> > > > > > bull...
>
> > > > > > apparently the only way the admin side of my site can upload an 
> > > > > > image
> > > > > > to a directory is by having "other" set to have full rwx set... ie
> > > > > > chmod **7 I'm not so sure this is a good thing to keep set as that
> > > > > > would give everyone, logged in or other, access to overwriting data,
> > > > > > adding stuff, etc... right?
>
> > > > > Who owns the files once uploaded?
>
> > > > > Whoever that is should be the owner of the directory. Sounds like you
> > > > > are running under Apache and don't understand that your code runs as
> > > > > the Apache user.
>
> > > > > Graham
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: db API where ...or...

2008-12-15 Thread Lars Stavholm

Thanks Tim, works like a charm.
/L

Tim Chase wrote:
>> when combining Django ORM criteria you get
>> the "...WHERE...AND..." clauses.
>>
>> How do I get the "...WHERE...OR..." clauses?
>>
>> Resorting to raw SQL?
> 
> 
> Use Q objects and OR them together:
> 
> http://www.djangoproject.com/documentation/models/or_lookups/
> 
> 
> Foo.objects.filter(
>Q(field1='baz') |
>Q(field1='bar') |
>Q(field2='spatula')
>)
> 
> 
> They should be groupable as well, so you can use
> 
>filter(
>  (Q(field1='foo') & Q(field2='bar'))
>  | Q(field1='baz')
>  )
> 
> -tim
> 
> 
> 
> 
> > 
> 



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Lars Stavholm

Aldo wrote:
> Yes I have tried that but still nothing - thats what lead me to
> looking at this!

Try with "USE_I18N = False" in settings.py.
Some sort of known issue, I do believe there's
a ticket somewhere confirming this.
/L

> On Dec 15, 3:28 pm, Lars Stavholm  wrote:
>> Aldo wrote:
>>> I am using django forms. I have created a model/form with 2 fields,
>>> name and date.
>>> Prior to saving the form i check if the form is_valid?
>>> if form.is_valid():
>>> form.save()
>>> My problem is it wants the date in the format - MM/DD/
>>> Otherwise it will not see the form as valid - and not save.
>>> How can i change this I want the date in the format DD/MM/
>> Maybe setting DATE_FORMAT in settings.py could help.
>>
>> http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-...
>>
>> /Lars
> > 
> 



--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: db API where ...or...

2008-12-15 Thread Tim Chase

> when combining Django ORM criteria you get
> the "...WHERE...AND..." clauses.
> 
> How do I get the "...WHERE...OR..." clauses?
> 
> Resorting to raw SQL?


Use Q objects and OR them together:

http://www.djangoproject.com/documentation/models/or_lookups/


Foo.objects.filter(
   Q(field1='baz') |
   Q(field1='bar') |
   Q(field2='spatula')
   )


They should be groupable as well, so you can use

   filter(
 (Q(field1='foo') & Q(field2='bar'))
 | Q(field1='baz')
 )

-tim




--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Yes I have tried that but still nothing - thats what lead me to
looking at this!

On Dec 15, 3:28 pm, Lars Stavholm  wrote:
> Aldo wrote:
> > I am using django forms. I have created a model/form with 2 fields,
> > name and date.
>
> > Prior to saving the form i check if the form is_valid?
>
> > if form.is_valid():
> >     form.save()
>
> > My problem is it wants the date in the format - MM/DD/
> > Otherwise it will not see the form as valid - and not save.
>
> > How can i change this I want the date in the format DD/MM/
>
> Maybe setting DATE_FORMAT in settings.py could help.
>
> http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-...
>
> /Lars
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: db API where ...or...

2008-12-15 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects


On Mon, Dec 15, 2008 at 18:35, Lars Stavholm  wrote:

>
> Hi all,
>
> when combining Django ORM criteria you get
> the "...WHERE...AND..." clauses.
>
> How do I get the "...WHERE...OR..." clauses?
>
> Resorting to raw SQL?
>
> Kinda' lost, any input appreciated
> /Lars
>
>
> >
>

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



db API where ...or...

2008-12-15 Thread Lars Stavholm

Hi all,

when combining Django ORM criteria you get
the "...WHERE...AND..." clauses.

How do I get the "...WHERE...OR..." clauses?

Resorting to raw SQL?

Kinda' lost, any input appreciated
/Lars


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Lars Stavholm

Aldo wrote:
> I am using django forms. I have created a model/form with 2 fields,
> name and date.
> 
> Prior to saving the form i check if the form is_valid?
> 
> if form.is_valid():
> form.save()
> 
> My problem is it wants the date in the format - MM/DD/
> Otherwise it will not see the form as valid - and not save.
> 
> How can i change this I want the date in the format DD/MM/

Maybe setting DATE_FORMAT in settings.py could help.

http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-format

/Lars


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Let me add, that my model contains this

mydate = models.DateTimeField().input_formats = ('%Y.%m.%d %H:%M:%S',)

But when i use the input_formats arg it allows my field to accept any
numeric data
eg: 2342342/42354235 is now accepted.

On Dec 15, 2:57 pm, Aldo  wrote:
> I am using django forms. I have created a model/form with 2 fields,
> name and date.
>
> Prior to saving the form i check if the form is_valid?
>
> if form.is_valid():
>     form.save()
>
> My problem is it wants the date in the format - MM/DD/
> Otherwise it will not see the form as valid - and not save.
>
> How can i change this I want the date in the format DD/MM/
>
> Please help
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django Forms Date Format

2008-12-15 Thread Aldo

I am using django forms. I have created a model/form with 2 fields,
name and date.

Prior to saving the form i check if the form is_valid?

if form.is_valid():
form.save()

My problem is it wants the date in the format - MM/DD/
Otherwise it will not see the form as valid - and not save.

How can i change this I want the date in the format DD/MM/

Please help
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem with field validation in 1.02

2008-12-15 Thread rtmie

H i ,
I am trying to migrate a project from 0.95 to 1.02 and so have to
migrate all of my old model based validator stuff in the new forms
style( my first encounter with the new forms style).

I am having a problem with the following:

in my model I have a AppUser class, with username , password , email
etc and I have a requirement that the username be unique , regardless
of case. I have a valifdation funtion to check this and raise a
ValidationError,
however when I call it with a duplicate name via form.isValid() I get
a return value of False (i.e validation failed as expected) BUT the
form.errors list is empty. I am obviously doing something dumb, but
can't for the life of me figure it out.
Can anyone see if I am missing some step:

Model:

class AppUser(models.Model):
name = models.CharField(_('name'),
max_length=100,
db_column='name',
unique=True)
email = models.EmailField(_('email'),
 db_column='email',
 blank=True,
 max_length=320)
password = models.CharField(_('password'),
max_length=30,
db_column='password')


Form:
class AppUserForm(ModelForm):
class Meta:
model = AppUser

def clean_name(self):
name = self.cleaned_data["name"]
if self.instance.id:
cps = AppUser.objects.exclude(id__exact=self.instance.id)
else:
cps = AppUser.objects.all()
for index in range(0,len(cps)):
if upper(cps[index].name) == upper(name):
raise forms.ValidationError, "App user name must
be unique, regardless of \
case"
return name

View:

def createUser(request):
form = AppUserForm()
if request.method =='POST':
form.data = request.POST
if form.is_valid():
log.debug("saving valid user")
cp   = form.save(True)
else:
log.error( form.errors)
log.error("error list: %s" , str(form.errors))
log.error("failed  App User validation ")

log output
app2008-12-15 14:46:26,384 [ERROR] error list:<--
expected to see something here
app2008-12-15 14:46:26,384 [ERROR] failed  CP validation


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem with field validation in 1.02

2008-12-15 Thread rtmie

H i ,
I am trying to migrate a project from 0.95 to 1.02 and so have to
migrate all of my old model based validator stuff in the new forms
style( my first encounter with the new forms style).

I am having a problem with the following:

in my model I have a AppUser class, with username , password , email
etc and I have a requirement that the username be unique , regardless
of case. I have a valifdation funtion to check this and raise a
ValidationError,
however when I call it with a duplicate name via form.isValid() I get
a return value of False (i.e validation failed as expected) BUT the
form.errors list is empty. I am obviously doing something dumb, but
can't for the life of me figure it out.

Model:

class AppUser(models.Model):
name = models.CharField(_('name'),
max_length=100,
db_column='name',
unique=True)
email = models.EmailField(_('email'),
 db_column='email',
 blank=True,
 max_length=320)
password = models.CharField(_('password'),
max_length=30,
db_column='password')


Form:
class AppUserForm(ModelForm):
class Meta:
model = AppUser

def clean_name(self):
name = self.cleaned_data["name"]
if self.instance.id:
cps = AppUser.objects.exclude(id__exact=self.instance.id)
else:
cps = AppUser.objects.all()
for index in range(0,len(cps)):
if upper(cps[index].name) == upper(name):
raise forms.ValidationError, "App user name must
be unique, regardless of \
case"
return name

View:

def createUser(request):
form = AppUserForm()
if request.method =='POST':
form.data = request.POST
if form.is_valid():
log.debug("saving valid user")
cp   = form.save(True)
else:
log.error( form.errors)
log.error("error list: %s" , str(form.errors))
log.error("failed  App User validation ")

log output
app2008-12-15 14:46:26,384 [ERROR] error list:
app2008-12-15 14:46:26,384 [ERROR] failed  CP validation


--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with make-messages.py russian language

2008-12-15 Thread Ramiro Morales

On Mon, Dec 15, 2008 at 12:15 PM, Dafidov  wrote:
>
> Hi Karen.
> Thank You for quick answer.
> Unfortunately after check and changing commend still not work :(
> Before I was using django 0.9.6 changeset 7496 and all worked fine.
> It's strange because when I'm using old command
> make-messages.py -l pl  I have no errors...
>
> I was checking coding and in all languages files - they are saved with
> utf-8 encoding so it's not a problem too.
> I' working on:
> Distributor ID: Ubuntu
> Description:Ubuntu 8.04.1
> Release:8.04
> Codename:   hardy
>
> and have xgettext (GNU gettext-tools) 0.17
>
> I'm using as translation editor poedit in version 1.3.9.
>
> By saying that make-massages suspend - i have on my mind that in
> console it looks like it is working - but never ends... can wait hours
> and nothing :/

If you are using a correctly installed 1.0.2 then make-messaages should
be showing something like:

$ make-messages
make-messages has been moved into django-admin.py
Please run "django-admin.py makemessages " instead.

If yours don't, maybe leftovers of aprevious installation
are still in /usr/sbin or similar?

>
> Do You have any other ideas why make-massages.py and django-admin.py
> makemessages -l ru doesn't work correct on Russian language ?
>

Something you could do is to manually apply the bisection method
between your revision that worked (r7496) and 1.0.2 (r9503)
to try to find the commit that broke things for you. The functionality
was moved from make-messages to django-admin at revision 7844.

Regards,

-- 
 Ramiro Morales

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where to I need to install the Python database bindings?

2008-12-15 Thread Karen Tracey
On Mon, Dec 15, 2008 at 9:13 AM, Samir van de Sand  wrote:

> Hello everyone,
>
> I know this is am embarrassing question but I have to ask: Given that
> django is running on one machine and the database is running on another
> machine, where do I have install the python database bindings? I presume on
> the machine where django is running?
>

Yes, where Django is running.

Karen

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread coulix

Hello Djangonauts,
I have a custom widget to create a kind of group list which ommits the
last "/" at the end of an input field.
Making html validation to fail.

The important code is here:

   rendered_cb = cb.render(name, option_value)
print rendered_cb
output.append(u'%s %s' % (
option_label,
rendered_cb,
option_label)
)
...
   return mark_safe(u'\n'.join(output))

The shell output gives me






Thats all good

But then HTML output after mark_safe takes this input "/" away
Langues
 Anglais

 Espagnol
 Japonais


If i do the safe as a filter it still remove the last /, what is the
solution ?

(for now not validating html is not the end of the world)

Greg.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Where to I need to install the Python database bindings?

2008-12-15 Thread Samir van de Sand
Hello everyone,

I know this is am embarrassing question but I have to ask: Given that django
is running on one machine and the database is running on another machine,
where do I have install the python database bindings? I presume on the
machine where django is running?

regards Samir

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with make-messages.py russian language

2008-12-15 Thread Dafidov

Hi Karen.
Thank You for quick answer.
Unfortunately after check and changing commend still not work :(
Before I was using django 0.9.6 changeset 7496 and all worked fine.
It's strange because when I'm using old command
make-messages.py -l pl  I have no errors...

I was checking coding and in all languages files - they are saved with
utf-8 encoding so it's not a problem too.
I' working on:
Distributor ID: Ubuntu
Description:Ubuntu 8.04.1
Release:8.04
Codename:   hardy

and have xgettext (GNU gettext-tools) 0.17

I'm using as translation editor poedit in version 1.3.9.

By saying that make-massages suspend - i have on my mind that in
console it looks like it is working - but never ends... can wait hours
and nothing :/

Do You have any other ideas why make-massages.py and django-admin.py
makemessages -l ru doesn't work correct on Russian language ?

Best regards
Dafidov

On 12 Gru, 16:03, "Karen Tracey"  wrote:
> On Fri, Dec 12, 2008 at 8:24 AM, Dafidov  wrote:
>
> > Hello.
> > I didn't found in Internet any comments in this subject thats why I'm
> > writing. I don't know why but after moving to django 1.0.2 I have a
> > problem with creating po files in Russian language. The German and
> > Polish work fine but when I'm trying do it on Russian the process
> > suspends and don't react.
> > {{{
> > make-messages.py -l ru
> > }}}
> > {{{
> > make-messages.py -a
> > }}}
> > Both are not suspending reaching Russian language.
> > Before update all worked fine.
> > Does anyone have idea why it doesn't work - had any one same problem ?
> > Any suggestions, solutions :) ?
>
> (You don't say what level "before update" was.  That might have been useful
> information.)
>
> You shouldn't be using make-messages.py with Django 1.0.2, as that function
> was moved to a django-admin.py command 
> (seehttp://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Trans...).
> If you were using the 1.0.2 version of make-messages.py you'd just get an
> error message since the 1.0.2 version of that script just prints out that
> you should be using the other command.
>
> There's another change listed on that page that you should be aware of:
>
> http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#POfil...
>
> I do not know that either of these could cause makemessages to hang; if you
> switch to using the correct command and verify that the 2nd change I noted
> isn't a problem and still have an issue with the command hanging for Russian
> please re-post and inslude the OS you are using and the gettext utilities
> version you have installed (output of xgettext --version).
>
> Karen
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



MarkSafe and widget rendering "/" disapeared

2008-12-15 Thread coulix

Hello Djangonauts,
I have a custom widget to create a kind of group list which ommits the
last "/" at the end of an input field.
Making html validation to fail.

The important code is here:

   rendered_cb = cb.render(name, option_value)
print rendered_cb
output.append(u'%s %s' % (
option_label,
rendered_cb,
option_label)
)
...
   return mark_safe(u'\n'.join(output))

The shell output gives me






Thats all good

But then HTML output after mark_safe takes this input "/" away
Langues
 Anglais

 Espagnol
 Japonais


If i do the safe as a filter it still remove the last /, what is the
solution ?

(for now not validating html is not the end of the world)

Greg.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django newbie observation

2008-12-15 Thread Robin Jakobsson

I agree on the Shipping site.
Let's start a project?

Cheers,
Robin

On 13 Nov, 17:45, "thi.l...@gmail.com"  wrote:
> > You will find lots of excellent examples of Django projects [...]
>
> It is sometimes difficult to know what Django version each project was
> based on (especially those from djangosites.org, some of them are
> still using Manipulator stuff).
> There were many changes in trunk since 0.95. However, since Django hit
> 1.0, we can probably expect more manageable backward-
> incompatibilities.
>
> Still, Ayayalar has a point. Shipping(*) a showcase website with
> Django would be nice:
> - it would stay synchronized with code changes
> - it could introduce new features with full examples (not to pollute
> documentation)
> - it would provide good material for the tutorial
> - let's call it "instant convince-your-manager kit"
>
> (*) A more realistic approach would be to consider this initiative as
> a separate project, with a focus on synchronization to the
> corresponding Django code version.
> Pinax and the like act more like repositories for reusable apps, and
> are not sold as introduction material for newcomers.
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: RHEL 5.2 + mysql + Django 1.0 => Django 0.95.4

2008-12-15 Thread Rachel Willmer

Thanks for the reply.

Unfortunately the egg gives me the same problems as when I attempt an
install from the tarball.

Any RHEL users out there encountered this problem and fixed it?

Rachel

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: login django using curl

2008-12-15 Thread Brett Parker

On 14 Dec 12:07, Malcolm Tredinnick wrote:
> 
> 
> On Sat, 2008-12-13 at 14:44 -0800, Adrián Ribao wrote:
> > Hello, I'm writing a script and I'd like to login into a django webapp
> > using pycurl or urllib.
> > I've problems with the cookies, and every time the message is: "The
> > session has expired"
> > 
> > Does anybody know how can I make it?
> 
> You forgot to provide an example of what you are doing at the moment, so
> it's a little tricky to work out what needs correcting. I'll make some
> guesses:
> 
> (1) Are you remembering to include all the form fields? In particular,
> that message will be triggered if you leave out the hidden field in the
> form ("this_is_the_login_form=1").
> 
> (2) Are you remembering to track cookie value updates? Once you log in
> -- whenever you change from an anonymous session to an authenticated one
> -- Django changes the value of the cookie. That is, your session id
> changes. So the cookie value that is sent when you first receive the
> login form is not the same as the value that needs to be sent after
> login.
> 
> All that being said, I use curl quite a bit to test interactions with
> Django. My login line generally looks like:
> 
> curl -c cookies.txt -b cookies.txt -L -d @login-form.txt 
> http://localhost:8000/admin/
> 
> where login-form.txt contains something like
> 
> username=malcolm=secret_is_the_login_form=1
> 
> I have a few other files for other common actions, too, and generally
> shell script my way around the admin site and other things I am
> developing in that fashion if I need to check that things haven't
> changed when I'm only intended to make internal changes.

I'd recommend using the Browser class of python mechanize:
http://wwwsearch.sourceforge.net/mechanize/

Should make most operations a lot easier, plus you can check for links
etc, then just "click" on them which is rather handy.

I'm using it to monitor a few sites (not, unfortunately, written in
django), and it is rather nice being able to just click round the place
and get data out again when needed. Mechanize + BeautifulSoup is
a very nice combination indeed.

Thanks,
-- 
Brett Parker

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: SOAPpy and pyxml installation/usage

2008-12-15 Thread Steve

OK. I'm having second thoughts on suds. It seems to work great some
times, but not so great on others. I have the following code, where
vid is the wsdl of the video.
Many of them fail. I got these wsdl's from http://www.xmethods.net and
presumably they're good.

def check(vid):
   try:
  client = Client(vid)
  print "succeeded: " + vid
   except:
  print "failed: " + vid

for x in wsdl:
   check(x)

It fails quite a bit, just to load the wsdl file. Here's the results:
succeeded: http://ws2.fraudlabs.com/mailboxvalidator.asmx?wsdl
succeeded: http://www.imcomponents.com/imsoap/?wsdl
succeeded: 
http://coeservice.en.kku.ac.th:8080/TemperatureConvertor/TemperatureConvertorService?WSDL
failed: http://ws.strikeiron.com/RealTimeNASDAQStockQuotes?WSDL
failed: http://ws.strikeiron.com/RealTimeStockQuotes3?WSDL
failed: http://ws.strikeiron.com/DelayedStockQuotes15min?WSDL
failed: http://www.siprod.net/webservices/xemail/xemailwebservice.asmx?WSDL
failed: https://api.postalmethods.com/PostalWS.asmx?WSDL
succeeded: http://ws.fraudlabs.com/browserobjectwebservice.asmx?wsdl
succeeded: http://ws.fraudlabs.com/areacodeworldwebservice.asmx?wsdl
succeeded: http://ws.cdyne.com/ProfanityWS/Profanity.asmx?wsdl
succeeded: http://euro2008.dataaccess.eu/footballpoolwebservice.wso?WSDL
succeeded: http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl
succeeded: http://www.ecubicle.net/whois_service.asmx?WSDL

If anyone has any thoughts, I'm all ears. I'm going to try to post
this on the suds page, see if they can't fix it.

-Steve

On Dec 12, 12:24 am, Jarek Zgoda  wrote:
> Wiadomość napisana w dniu 2008-12-11, o godz. 09:31, przez Steve:
>
> > This may be a more of a generic Python question, but I'm working with
> > Django so thought that I'd see if there's a Django specific solution
> > to it.
>
> > I'm trying to work with SOAP. I'm new to it and a Jr. programmer as
> > well. From Dive into Python it has this great example about how to
> > handle SOAP calls.
> >http://www.diveintopython.org/soap_web_services/index.html
>
> Drop SOAPpy and ZSI, they are not documented and nearly dead. Try suds.
>
> --
> We read Knuth so you don't have to. - Tim Peters
>
> Jarek Zgoda, R, Redefine
> jarek.zg...@redefine.pl
--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to hide/show an admin field when a radio field is selected

2008-12-15 Thread Fabio Natali

Fabio Natali wrote:
[...]
> Dear all,
> 
> say I have a model "boat" with a radio field which let me choose
> between "sailing boat" and "motor boat".
> 
> ##
> 
> class Boat(models.Model):
> name = models.CharField(max_length=30)
> TYPE = (
> ('S', 'Sailing Boat'),
> ('M', 'Motor Boat'),
> )
> type = models.CharField(max_length=1, choices=TYPE, default='S')
> sailmaker = models.ForeignKey(Sailmaker,blank=True,null=True)
> motor = models.ForeignKey(Motor,blank=True,null=True)
> 
> class BoatAdmin(admin.ModelAdmin):
> radio_fields = {'type': admin.VERTICAL}
> 
> ##
> 
> This is the behaviour I would like to have for my admin: when I select
> the "Sailing boat" radio button, the field sailmaker is shown and the
> field motor is hidden (to fix ideas, just suppose that sailing boats
> don't have any motors). Viceversa, when I select the "Motor boat"
> radio button, motor is shown and sailmaker is hidden.

I got this piece of js which seems to fit my need [0]. However, I'm
still wondering how to integrate it into my Django code.

I have a radio button in my model which is called "type". That button
should be the one which calls the js. Any tips on how to get this?

Thank you very much, Fabio.

[0] http://dpaste.com/hold/99219/

-- 
Fabio Natali

--~--~-~--~~~---~--~~
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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---