Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Brandon Taylor

Thank you very much to everyone for your help. It took a few tries,
but I finally got the paths configured correctly in my setup.conf for
psycopyg. I'm working through the first tutorial. Looks like I need to
grab the newest Django source from subversion. But, I'm able to create
and sync my models now.

I haven't touched Python in a long time, I've been mostly working in
Microsoft technologies over the past few years, but I've become quite
the fan of Ruby on Rails over the past few months. I'm a senior
developer with Avenue A | Razorfish in Austin, and I'm looking into
Django as a possible competitor to Java. Python is much more mature
than Ruby, so our technical architects aren't quite as eager to
support Rails as I'd like.

Django seems very similar to Rails, so I'm hopeful it won't take long
to get up to speed. I have to say the installation of all of the
necessary softwares to get Django running wasn't nearly as smooth as
Rails, especially on the OS X side, so I'm hopeful that the speed of
Python will make up for that.

Does anyone have an example of a good organizational schema for an
Ajax-enabled Django site? By that, I mean how are you guys organizing
your directories? I'm a little fuzzy on the structure of a "typical"
website. What should the public-facing root of the site be? Should my
Python code go outside that, similar to the way Rails has its "App"
folder and "Public" folders?

Again, my sincere thanks for your advice and guidance!
Brandon

On Sep 2, 9:37 pm, Nick Fishman <[EMAIL PROTECTED]> wrote:
> On Sep 2, 9:37 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote:
>
> > Looks like you're missing some header files...
>
> > Maybe postgres didn't put everything where it needed to be. You also may
> > need the dev packages for postgres.
>
> The problem is, indeed, in the development packages. There's a package
> called libpq-dev that contains this file (stored in /usr/include/
> postgresql/libpq-fe.h). I installed postgresql-server-dev-8.2 and it
> got installed as a dependency, but you might be able to install the
> package on its own.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Signals Question - Firing off an email after a save

2007-09-02 Thread Jeremy Dunck

On 9/2/07, Jack E. Wilkinson <[EMAIL PROTECTED]> wrote:
...
> I've got a very simple model, two databases and I'm using the admin
> interface.  What I need is when one of the databases gets a change made
> to it, for an email to be sent out to a specific group (the group never
> changes, however, the subject and message content should change).

> Here is the model I have written.  When the Environment class changes is
> when I need to send out the email.


If you want to send mail when a *specific* model changes, you don't
need signals.

Note that signals are both single-process and synchronous, so that
implementing using a built-in signal like post_save would be roughly
the same as just overriding the model's save method.

In your model class, just override the save method, and make sure to
call the base save.

from django.core.mail import send_mail

class Environment(models.Model):
...
  def save():
 super(Environment, self).save()
 send_mail('Subject here', 'Here is the message.', '[EMAIL PROTECTED]',
['[EMAIL PROTECTED]','[EMAIL PROTECTED]'])


More:
http://www.djangoproject.com/documentation/email/#quick-example

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Signals Question - Firing off an email after a save

2007-09-02 Thread Thejaswi Puthraya

> I've got a very simple model, two databases and I'm using the admin
> interface.  What I need is when one of the databases gets a change made
> to it, for an email to be sent out to a specific group (the group never
> changes, however, the subject and message content should change).

Use Django signals in conjuction with Django's mail sending
routinesfor more information on signals check out
www.mercurytide.co.uk/whitepapers/django-signals
http://code.djangoproject.com/wiki/Signals
http://feh.holsman.net/articles/2006/06/13/django-signals
and about sending mails check out
http://www.djangoproject.com/documentation/email/ (this documentation
needs to be updated...i would recommend you go through the code)

Cheers
Thejaswi Puthraya


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to do a recursive inclusion forloop in a django template

2007-09-02 Thread Arik Jones

I have a pages model that has a recursive relationship to itself. Lets
say I list only pages that are root parents. In my forloop, how do I
display with each root parent page all its children, including
children of children as well?

Your help and input is greatly appreciated. Thank you!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Hi!

2007-09-02 Thread Uncensored

Check out my recording your sure to get a laugh!!

http://www.loudio.com/Podcasts/Psyco-Goes-Nuts-on-the-Cable-Representative-LMFAO.40918


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Signals Question - Firing off an email after a save

2007-09-02 Thread Jack E. Wilkinson

Good day,

Being a *VERY* new admirer of Django, I've started an application that
I've gotten slightly hung on due to a lack of understanding the
documentation.

I've got a very simple model, two databases and I'm using the admin
interface.  What I need is when one of the databases gets a change made
to it, for an email to be sent out to a specific group (the group never
changes, however, the subject and message content should change).

What I would like to see is a code example of just how to accomplish this.

Here is the model I have written.  When the Environment class changes is
when I need to send out the email.
---

# environment status manager - copyright 2007 rackspace managed hosting
from django.db import models

# we'll need these in a couple of places.
STATUS_CHOICES = (
  ('G', 'Green'),
  ('Y', 'Yellow'),
  ('R', 'Red'),
)


# define the environment (tho it still needs who updated it).
class Environment(models.Model):
  short_name = models.CharField("Short Name", maxlength=8, blank=False,
unique=True)
  full_name = models.CharField("Fully Qualified Domain Name",
maxlength=64, blank=False, unique=True)
  status = models.CharField(maxlength=1, choices=STATUS_CHOICES,
radio_admin=True, blank=False)
  lastupdated = models.DateTimeField(_('action time'), auto_now=True)
  oktoadd = models.BooleanField("Ok to add new clients", default=False)
  def __unicode__(self):
return self.short_name
  class Admin:
list_display = ('short_name', 'colored_stat', 'oktoadd', 'full_name')
list_filter = ['status', 'oktoadd']
search_fields = ['short_name', 'full_name']
ordering = ['short_name']
  def colored_stat(self):
if (self.status == 'G'):
  col_code = '008000'
  col_name = 'Green'
if (self.status == 'R'):
  col_code = 'FF'
  col_name = 'Red'
if (self.status == 'Y'):
  col_code = 'FFB900'
  col_name = 'Yellow'
return '%s' % (col_code, col_name)
  colored_stat.allow_tags = True
  colored_stat.short_description = 'Status'

# define the Note database (tho it still needs who updated it).
class Note(models.Model):
  env_key = models.ForeignKey(Environment)
  oneliner = models.CharField(maxlength=64, blank=False)
  bigtext = models.TextField(blank=True)
  lastupdated = models.DateTimeField(_('action time'), auto_now=True)
  def __unicode__(self):
return self.oneliner
  class Admin:
pass
list_display = ('env_key', 'oneliner', 'lastupdated')
list_filter = ['env_key']
search_fields = ['oneliner', 'bigtext']
date_hierarchy = 'lastupdated'
---

Many thanks in advance,
jack

-- 
    Jack E. Wilkinson
Managed Backup Admin III
    Software Developer
    [EMAIL PROTECTED]
Rackspace Managed Hosting(tm)   +1-210-312-4460


Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace
Managed Hosting. Any dissemination, distribution or copying of the enclosed
material is prohibited. If you receive this transmission in error, please
notify us immediately by e-mail at [EMAIL PROTECTED], and delete the
original message. Your cooperation is appreciated.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



redirect with query

2007-09-02 Thread james_027

hi,

is there a django/pythonic way to do this

return HttpResponseRedirect('/main?app_message=you have no permission
on %s vs ' % (function))

can the reverse() help? I think the args and kwargs are for the
methods parameters ...

Thanks
james


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: web site

2007-09-02 Thread Amirouche

I almost forgot...

welcome !

On Sep 3, 5:48 am, Amirouche <[EMAIL PROTECTED]> wrote:
> You may find this usefull toohttp://www.djangosites.org/tag/game/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: web site

2007-09-02 Thread Amirouche

You may find this usefull too
http://www.djangosites.org/tag/game/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



[ANN] Django Check Constraints

2007-09-02 Thread Thejaswi Puthraya

Hello Django Users,
I am happy to announce the release of Django Check Constraints, a
Google Summer of Code Project. This project implements Value-based and
Range-based constraints in Django's models. The project will help in
server side validation at the database-level without writing extra
lines of code. Currently it support three databases Postgresql, Sqlite
and Oracle (these databases support check constraints natively).

Here is a sample model that uses Django Check Constraints:

class Product(models.Model):
prod_name   =models.CharField(maxlength=50)
price=models.IntegerField()
discount   =models.IntegerField()
tax_percent  =models.IntegerField()
sale_start_date =models.DateField()
sale_end_date  =models.DateField()

class Meta:
constraints = (

("check_price",Check(price__gte = 0) &
Check(price__gte = 'discount')),
("check_tax",Check(tax_percent__gte =
10,tax_percent__lte = 20)),
 
("check_name",Check(name__not_in__upper = ("PRODA","PRODB","PRODC"))),
 
("check_discount_neq",Check(discount__neq = 0)),
 
("check_date",Check(sale_start_date__between =
[date(2007,01,01),date(2007,12,31)])),
 
("check_date_start",Check(sale_start_date__lte = 'sale_end_date')),

  )


The equivalent SQL generated on syncdb is (in Postgresql):

BEGIN;
CREATE TABLE "test_app_product" (
"id" serial NOT NULL PRIMARY KEY,
"prod_name" varchar(50) NOT NULL,
"price" integer NOT NULL,
"discount" integer NOT NULL,
"tax_percent" integer NOT NULL,
"sale_start_date" date NOT NULL,
"sale_end_date" date NOT NULL,
CONSTRAINT "check_price" CHECK ( ("price" >= 0) AND ("price" >=
discount) ),
CONSTRAINT "check_tax" CHECK ( ("tax_percent" <= 20) AND
("tax_percent" >= 10) ),
CONSTRAINT "check_prod_name" CHECK (upper(prod_name) not in
('PRODA','PRODB','PRODC')),
CONSTRAINT "check_discount_neq" CHECK ("discount" <> 0),
CONSTRAINT "check_date" CHECK ("sale_start_date" between date
'2007-01-01' AND date '2007-12-31'),
CONSTRAINT "check_date_start" CHECK ("sale_start_date" <=
sale_end_date)
)
;
COMMIT;

For more details you can check 
http://code.google.com/p/django-check-constraints/

On how to use it with newforms you can visit
http://thejuhyd.blogspot.com/2007/07/django-newforms-and-django-check.html
and
http://thejuhyd.blogspot.com/2007/08/django-newforms-and-django-check.html

Hoping to receive your feedback/suggestions/criticisms.

Cheers
Thejaswi Puthraya


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Nick Fishman

On Sep 2, 9:37 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote:
> Looks like you're missing some header files...
>
> Maybe postgres didn't put everything where it needed to be. You also may
> need the dev packages for postgres.

The problem is, indeed, in the development packages. There's a package
called libpq-dev that contains this file (stored in /usr/include/
postgresql/libpq-fe.h). I installed postgresql-server-dev-8.2 and it
got installed as a dependency, but you might be able to install the
package on its own.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread James Bennett

On 9/2/07, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> I have Python 2.5.1 and Django installed and running on OS X 10.4.10,
> but can't seem to get either the Psycopg2 or MySQL-python bindings
> installed so I can actually use a database with Django.

For Mac, this is the easiest way to get the necessary modules:

http://pythonmac.org/packages/py25-fat/index.html


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Sharing models between applications

2007-09-02 Thread qwerty
You mean like having a "neutral" application?

I was thinking in this, is a good solution I just don't wanna miss some
already built-in solution for this.

Thanks!
Angel

2007/9/2, Tim Chase <[EMAIL PROTECTED]>:
>
>
> > I've a projects that should share the db models
> >
> > I know I can create a models.py file in the project's home dir but
> > manage.py syncdb doesn't read it from there (and I really want to keep
> > it all on Python code without need to run mysql -u app -p)
>
> I've done this in one project by having a "core"
> (core/central/common...whatever you want to call it) app that
> holds all my shared models.  Just make sure that your settings.py
> file has it included in the INSTALLED_APPS setting.
>
> I then simply "import core" and then can refer to my shared
> models in any related app.  Since it's in the INSTALLED_APPS the
> "manage.py syncdb" can manage the tables for you like it does
> your other models.
>
> -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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Another UnicodeError: django-registration or send_mail

2007-09-02 Thread James Bennett

On 9/2/07, patrickk <[EMAIL PROTECTED]> wrote:
> I´m using django-registration and changed line 80 of models.py from
> subject = "Account activation for %s" % current_domain
> to
> subject = "Account-Aktivierung für %s" % current_domain

Try

subject = u"Account-Aktivierung für %s" % current_domain


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: WordPress to Django Migration App

2007-09-02 Thread Austin Govella

On 8/31/07, Peter Baumgartner <[EMAIL PROTECTED]> wrote:
> My goal for this app was to lower the bar as much as possible for WP
> users wanting to try out Django. This is the path of least resistance
> for WP users to get their feet wet w/ Django.

That's a load of crap. Until deploying Django sites is a one or two
click thing (or an upload the files thing), more analagous to how easy
it is to deploy stuff in php, there will continue to be a HUGE gulf
between the people that could and would use Django and those that
actually do.

I love Django, but deployment is cumbersome.



-- 
Austin Govella
Thinking & Making: IA, UX, and IxD
http://thinkingandmaking.com
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Todd O'Bryan

Looks like you're missing some header files...

On Sun, 2007-09-02 at 16:14 -0700, Brandon Taylor wrote:
> Hi Todd,
> 
> Here is a copy of my terminal session:
> 
> running install
> running build
> running build_py
> running build_ext
> Warning: /bin/sh: line 1: pg_config: command not found

Maybe postgres didn't put everything where it needed to be. You also may
need the dev packages for postgres.

> building 'psycopg2._psycopg' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
> fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
> fno-common -dynamic -DNDEBUG -g -O3 -DPY_MAJOR_VERSION=2 -
> DPY_MINOR_VERSION=5 -DHAVE_PYBOOL=1 -DHAVE_DECIMAL=1 -
> DHAVE_PYDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -
> DPSYCOPG_VERSION="2.0.6 (dec dt ext pq3)" -DPSYCOPG_EXTENSIONS=1 -
> DPSYCOPG_DISPLAY_SIZE=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -
> DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/
> 2.5/include/python2.5 -I. -c psycopg/psycopgmodule.c -o build/
> temp.macosx-10.3-fat-2.5/psycopg/psycopgmodule.o
> In file included from psycopg/psycopgmodule.c:29:
> ./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or
> directory

This looks like a missing library and all the warnings below could be
problems with incompatibility between versions of gcc.

Have you tried fink?




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Sharing models between applications

2007-09-02 Thread Tim Chase

> I've a projects that should share the db models
>
> I know I can create a models.py file in the project's home dir but
> manage.py syncdb doesn't read it from there (and I really want to keep
> it all on Python code without need to run mysql -u app -p)

I've done this in one project by having a "core"
(core/central/common...whatever you want to call it) app that
holds all my shared models.  Just make sure that your settings.py
file has it included in the INSTALLED_APPS setting.

I then simply "import core" and then can refer to my shared
models in any related app.  Since it's in the INSTALLED_APPS the
"manage.py syncdb" can manage the tables for you like it does
your other models.

-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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Sharing models between applications

2007-09-02 Thread [EMAIL PROTECTED]

Hi all,

First I'm new to this list, so be patient with me as english isn't my
first lang :D

I've a projects that should share the db models, I know this is easy
as any app can use the models from other app with a simple "from
app.models import *" but as those models doesn't really go in any of
the apps but instead are part of the whole project I want a more
generic place where to put them.

I know I can create a models.py file in the project's home dir but
manage.py syncdb doesn't read it from there (and I really want to keep
it all on Python code without need to run mysql -u app -p)

Is there any magic solution to this "philosofical" problem?

Thanks,
Angel


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Griffin Caprio

You may need to edit the setup.cfg file to point to the correct  
location of your pg_config file.  For example: /usr/local/pgsql/bin.

- Griffin

On Sep 2, 2007, at 6:14 PM, Brandon Taylor wrote:

>
> Hi Todd,
>
> Here is a copy of my terminal session:
>
> running install
> running build
> running build_py
> running build_ext
> Warning: /bin/sh: line 1: pg_config: command not found
> building 'psycopg2._psycopg' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
> fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
> fno-common -dynamic -DNDEBUG -g -O3 -DPY_MAJOR_VERSION=2 -
> DPY_MINOR_VERSION=5 -DHAVE_PYBOOL=1 -DHAVE_DECIMAL=1 -
> DHAVE_PYDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -
> DPSYCOPG_VERSION="2.0.6 (dec dt ext pq3)" -DPSYCOPG_EXTENSIONS=1 -
> DPSYCOPG_DISPLAY_SIZE=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -
> DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/
> 2.5/include/python2.5 -I. -c psycopg/psycopgmodule.c -o build/
> temp.macosx-10.3-fat-2.5/psycopg/psycopgmodule.o
> In file included from psycopg/psycopgmodule.c:29:
> ./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or
> directory
> In file included from psycopg/psycopgmodule.c:29:
> ./psycopg/connection.h:56: error: parse error before 'PGconn'
> ./psycopg/connection.h:56: warning: no semicolon at end of struct or
> union
> ./psycopg/connection.h:83: error: parse error before '}' token
> ./psycopg/connection.h:83: warning: data definition has no type or
> storage class
> ./psycopg/connection.h:86: error: parse error before '*' token
> ./psycopg/connection.h:87: error: parse error before '*' token
> ./psycopg/connection.h:88: error: parse error before '*' token
> ./psycopg/connection.h:89: error: parse error before '*' token
> ./psycopg/connection.h:90: error: parse error before '*' token
> ./psycopg/connection.h:91: error: parse error before '*' token
> In file included from psycopg/psycopgmodule.c:30:
> ./psycopg/cursor.h:40: error: parse error before 'connectionObject'
> ./psycopg/cursor.h:40: warning: no semicolon at end of struct or union
> ./psycopg/cursor.h:42: error: parse error before ':' token
> ./psycopg/cursor.h:43: error: parse error before ':' token
> ./psycopg/cursor.h:44: error: parse error before ':' token
> ./psycopg/cursor.h:56: error: parse error before '*' token
> ./psycopg/cursor.h:56: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:58: error: parse error before 'lastoid'
> ./psycopg/cursor.h:58: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:80: error: parse error before '}' token
> ./psycopg/cursor.h:80: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:83: error: parse error before '*' token
> In file included from psycopg/psycopgmodule.c:32:
> ./psycopg/microprotocols.h:54: error: parse error before
> 'connectionObject'
> ./psycopg/microprotocols.h:57: error: parse error before '*' token
> In file included from psycopg/psycopgmodule.c:29:
> ./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or
> directory
> In file included from psycopg/psycopgmodule.c:29:
> ./psycopg/connection.h:56: error: parse error before 'PGconn'
> ./psycopg/connection.h:56: warning: no semicolon at end of struct or
> union
> ./psycopg/connection.h:83: error: parse error before '}' token
> ./psycopg/connection.h:83: warning: data definition has no type or
> storage class
> ./psycopg/connection.h:86: error: parse error before '*' token
> ./psycopg/connection.h:87: error: parse error before '*' token
> ./psycopg/connection.h:88: error: parse error before '*' token
> ./psycopg/connection.h:89: error: parse error before '*' token
> ./psycopg/connection.h:90: error: parse error before '*' token
> ./psycopg/connection.h:91: error: parse error before '*' token
> In file included from psycopg/psycopgmodule.c:30:
> ./psycopg/cursor.h:40: error: parse error before 'connectionObject'
> ./psycopg/cursor.h:40: warning: no semicolon at end of struct or union
> ./psycopg/cursor.h:42: error: parse error before ':' token
> ./psycopg/cursor.h:43: error: parse error before ':' token
> ./psycopg/cursor.h:44: error: parse error before ':' token
> ./psycopg/cursor.h:56: error: parse error before '*' token
> ./psycopg/cursor.h:56: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:58: error: parse error before 'lastoid'
> ./psycopg/cursor.h:58: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:80: error: parse error before '}' token
> ./psycopg/cursor.h:80: warning: data definition has no type or storage
> class
> ./psycopg/cursor.h:83: error: parse error before '*' token
> In file included from psycopg/psycopgmodule.c:32:
> ./psycopg/microprotocols.h:54: error: parse error before
> 'connectionObject'
> ./psycopg/microprotocols.h:57: error: parse error before '*' token
> psycopg/psycopgmodule.c:101: error: parse error before '*' 

Re: Problem in current svn TRUNK

2007-09-02 Thread Peter Nixon

On Tue 28 Aug 2007, Michael Radziej wrote:
> On Tue, Aug 28, Michael Radziej wrote:
> > On Mon, Aug 27, Peter Nixon wrote:
> > > On Wed 11 Jul 2007, Michael Radziej wrote:
> > > > Hi,
> > > >
> > > > you're using the alpha version of SuSE ... well ... there might very
> > > > well be a problem very deep in one of the libraries. The alpha
> > > > releases aren't very reliable. I'd suggest that you try it with
> > > > another OS.
> > >
> > > Hi Guys
> > >
> > > I would like to point out that this problem still exists in Django
> > > post SVN 5608 (I just tried again with 6022). Since I initially
> > > reported this bug, I have moved from a 32bit to a 64bit notebook and
> > > have moved from "openSUSE 10.3 (i586) Alpha5" to a new install of
> > > "openSUSE 10.3 (X86-64) Beta2".
> > >
> > > Given that openSUSE 10.3 is going to be released soon, and that this
> > > is a 100% repeatable problem which only occurs post the unicode merge
> > > in Django, I would really appreciate if one of the developers could
> > > take the time to have a look at it.
> >
> > Is it possible at all to access the database from python with psycopg2?
>
> Ah, forget it. You wrote that it worked fine with older versions, so it
> can't be psycopg2.

Yes. Django 5608 works fine, but any newer version crashes. I have created 
rpm packages of both old and new versions and _nothing_ except the djano rpm 
changes in between tests.

> I'm really busted here. Please understand that I simply don't have the
> time to set up a SuSE box for this.

Tomorrow I will setup a vm for you running openSUSE 10.3 beta2 that you can 
play with to your hearts content. Would that be helpfull?

> As a last resort, you could try to find out at which line in the code the
> process aborts by adding print statements in the django database backend
> to psycopg2, or by single-stepping through the code with pdb.

-- 

Peter Nixon
http://peternixon.net/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Money: Make $3k in a week!

2007-09-02 Thread john jacob jingleheimer schmidt

Unbelievable and easy money solutions can be found at http://www.digitalyfe.com.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Brandon Taylor

Hi Todd,

Here is a copy of my terminal session:

running install
running build
running build_py
running build_ext
Warning: /bin/sh: line 1: pg_config: command not found
building 'psycopg2._psycopg' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
fno-common -dynamic -DNDEBUG -g -O3 -DPY_MAJOR_VERSION=2 -
DPY_MINOR_VERSION=5 -DHAVE_PYBOOL=1 -DHAVE_DECIMAL=1 -
DHAVE_PYDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -
DPSYCOPG_VERSION="2.0.6 (dec dt ext pq3)" -DPSYCOPG_EXTENSIONS=1 -
DPSYCOPG_DISPLAY_SIZE=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -
DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/
2.5/include/python2.5 -I. -c psycopg/psycopgmodule.c -o build/
temp.macosx-10.3-fat-2.5/psycopg/psycopgmodule.o
In file included from psycopg/psycopgmodule.c:29:
./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or
directory
In file included from psycopg/psycopgmodule.c:29:
./psycopg/connection.h:56: error: parse error before 'PGconn'
./psycopg/connection.h:56: warning: no semicolon at end of struct or
union
./psycopg/connection.h:83: error: parse error before '}' token
./psycopg/connection.h:83: warning: data definition has no type or
storage class
./psycopg/connection.h:86: error: parse error before '*' token
./psycopg/connection.h:87: error: parse error before '*' token
./psycopg/connection.h:88: error: parse error before '*' token
./psycopg/connection.h:89: error: parse error before '*' token
./psycopg/connection.h:90: error: parse error before '*' token
./psycopg/connection.h:91: error: parse error before '*' token
In file included from psycopg/psycopgmodule.c:30:
./psycopg/cursor.h:40: error: parse error before 'connectionObject'
./psycopg/cursor.h:40: warning: no semicolon at end of struct or union
./psycopg/cursor.h:42: error: parse error before ':' token
./psycopg/cursor.h:43: error: parse error before ':' token
./psycopg/cursor.h:44: error: parse error before ':' token
./psycopg/cursor.h:56: error: parse error before '*' token
./psycopg/cursor.h:56: warning: data definition has no type or storage
class
./psycopg/cursor.h:58: error: parse error before 'lastoid'
./psycopg/cursor.h:58: warning: data definition has no type or storage
class
./psycopg/cursor.h:80: error: parse error before '}' token
./psycopg/cursor.h:80: warning: data definition has no type or storage
class
./psycopg/cursor.h:83: error: parse error before '*' token
In file included from psycopg/psycopgmodule.c:32:
./psycopg/microprotocols.h:54: error: parse error before
'connectionObject'
./psycopg/microprotocols.h:57: error: parse error before '*' token
In file included from psycopg/psycopgmodule.c:29:
./psycopg/connection.h:27:22: error: libpq-fe.h: No such file or
directory
In file included from psycopg/psycopgmodule.c:29:
./psycopg/connection.h:56: error: parse error before 'PGconn'
./psycopg/connection.h:56: warning: no semicolon at end of struct or
union
./psycopg/connection.h:83: error: parse error before '}' token
./psycopg/connection.h:83: warning: data definition has no type or
storage class
./psycopg/connection.h:86: error: parse error before '*' token
./psycopg/connection.h:87: error: parse error before '*' token
./psycopg/connection.h:88: error: parse error before '*' token
./psycopg/connection.h:89: error: parse error before '*' token
./psycopg/connection.h:90: error: parse error before '*' token
./psycopg/connection.h:91: error: parse error before '*' token
In file included from psycopg/psycopgmodule.c:30:
./psycopg/cursor.h:40: error: parse error before 'connectionObject'
./psycopg/cursor.h:40: warning: no semicolon at end of struct or union
./psycopg/cursor.h:42: error: parse error before ':' token
./psycopg/cursor.h:43: error: parse error before ':' token
./psycopg/cursor.h:44: error: parse error before ':' token
./psycopg/cursor.h:56: error: parse error before '*' token
./psycopg/cursor.h:56: warning: data definition has no type or storage
class
./psycopg/cursor.h:58: error: parse error before 'lastoid'
./psycopg/cursor.h:58: warning: data definition has no type or storage
class
./psycopg/cursor.h:80: error: parse error before '}' token
./psycopg/cursor.h:80: warning: data definition has no type or storage
class
./psycopg/cursor.h:83: error: parse error before '*' token
In file included from psycopg/psycopgmodule.c:32:
./psycopg/microprotocols.h:54: error: parse error before
'connectionObject'
./psycopg/microprotocols.h:57: error: parse error before '*' token
psycopg/psycopgmodule.c:101: error: parse error before '*' token
psycopg/psycopgmodule.c: In function '_psyco_connect_fill_exc':
psycopg/psycopgmodule.c:104: error: 'conn' undeclared (first use in
this function)
psycopg/psycopgmodule.c:104: error: (Each undeclared identifier is
reported only once
psycopg/psycopgmodule.c:104: error: for each function it appears in.)
psycopg/psycopgmodule.c: In function 'psyco_connect':

Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Todd O'Bryan

On Sun, 2007-09-02 at 16:04 -0700, Brandon Taylor wrote:
> Hi everyone,
> 
> I have Python 2.5.1 and Django installed and running on OS X 10.4.10,
> but can't seem to get either the Psycopg2 or MySQL-python bindings
> installed so I can actually use a database with Django.
> 
> I have the latest version of PostgreSQL and MySQL5 installed and
> running. Can someone please get me pointed in the right direction?!
> 
> Many thanks in advance,
> Brandon

On my Mac, the main problem with Python is that I can't tell which
version it's using. I assume you've tried downloading psycopg2 and
running

$ sudo python setup.py install

from the terminal in the correct directory? If you have, what errors do
you get?

Todd


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread Brandon Taylor

Hi everyone,

I have Python 2.5.1 and Django installed and running on OS X 10.4.10,
but can't seem to get either the Psycopg2 or MySQL-python bindings
installed so I can actually use a database with Django.

I have the latest version of PostgreSQL and MySQL5 installed and
running. Can someone please get me pointed in the right direction?!

Many thanks in advance,
Brandon


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: web site

2007-09-02 Thread SmileyChris



On Sep 3, 5:12 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]>
wrote:
> I'm a newby..:-)
>
> Is Django good for make a web site like this?
>
> These are a web site for playing correspondence chess.
>
> The moves are stored with a database, with information about the players,
> tournament, rating, ecc..

One of our regulars (and our IRC full time helpdesk), Collin Grady is
involved in developing http://www.chesspark.com/ which is Django based.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



newsform question

2007-09-02 Thread pinco

Hi,

I'm new to Django and I'm evaluating this promising framework by
migrating a part of our e-commerce application from rails to Django
(and we are really amazed from the results, expecially for the speed
of the framework when compared to rails).

At the moment I'm implementing a prototype of the "show cart" page,
where the user should be able to see the items already added to the
cart, delete each item if needed, empty the cart or update the
quantities.

I'm in trouble with the "update quantity" (probably because I don't
know very well the framework).

I want to realize an "update quantity" system similar to that of
Amazon, in which there is a text field for each added product that
displays the actual quantity for each product.
The user should be able to change the quantity for each product and
then submit the new quantities with only one button (in other words,
just one form) regardless the number of products in the cart.

This is quite different, i.e., from the satchmo approach, where each
item has its own update quantity button (i.e. each cart product is
wrapped in its own form).

As a matter of fact, I want to use newforms library.

My models are something like the following:

class Cart():
#Contains all the items added to the cart
items = []
...

class FormForItemQuantity(forms.Form):
quantity = forms.CharField()

class CartItem():
obj=ProductOption()
quantity = 0
unit_price = 0
form_for_quantity = FormForItemQuantity()
...

The cart is saved in the session and only when converted in order to
the database. Therefore the models above don't subclass django models.

The view should be something like:

def show_cart(request):
cart = request.session.get('cart', None) or Cart()
for item in cart.items:
item.form_for_quantity= FormForItemQuantity({'quantity':
item.quantity})
return render_to_response('show_cart.html', {'cart':cart,
'num_items': cart.total_items})

def update_quantity(request):
if request.method == 'POST':
cart = request.session.get('cart', None) or Cart()
for item in cart.items:
if item.form_for_quantity.is_valid():
item.quantity =
int(item.form_for_quantity.cleaned_data['quantity'])

request.session['cart'] = cart
return HttpResponseRedirect('/carts/show/')


and the template something like:


Your Cart



Product
Quantity
Action

{%for item in cart.items%}

{{item.obj.full_name}}
{{item.form_for_quantity}}
Remove

{%endfor%}



No. items added to the cart: {{num_items}}
Empty the cart

Save the order


However, when the form is submitted, I'm not able to read the new
quantity data from the form. As a matter of fact, inside the generated
form all the text fields, as expected, have the same name.

How I can generate the form I need and read back the posted data?
Where I'm wrong?
Thank you in advance for any help and sorry if the answer may be
trivial.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: truncating posts with markdown

2007-09-02 Thread SmileyChris

On Sep 3, 9:34 am, "Evan H. Carmi" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I ran across a problem today with the list view of my blog. I am using
> markdown to create html tags for my post. In the list view I use the
> template tag truncate to cut off the number of words. This leaves open
> the html tags that markdown created.
>
> I am wondering what ways people get around this?

Use the truncate_html filter ;)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: markdown issue

2007-09-02 Thread Tim Chase

> but this is the same as enter twice,  user must remember to end with
> one or more space.
> 
> is there other plugin like markdown which is a truely what they is
> what they get?


Well, it's possible to pre-process the user's input with
something like

import re
add_br_re = re.compile('\n+')
in_text = get_text_from_user_somehow()
out_text = add_br_re.sub('\n\n', in_text)
process_with_markdown(out_text)

This will normalize all newlines to a pair of newlines.

-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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: markdown issue

2007-09-02 Thread [EMAIL PROTECTED]

thx ,Johnathan.
but this is the same as enter twice,  user must remember to end with
one or more space.

is there other plugin like markdown which is a truely what they is
what they get?
thx



On Sep 2, 11:25 pm, Jonathan Buchanan <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] wrote:
> > i use markdown for beautify content, but i found if enter once, there
> > will be no new line.
> > i need to enter twice to get a new line (as  )
>
> > how can i get a new line when enter once, you know our user do not
> > know they need to enter twice.
>
> "When you do want to insert a  break tag using Markdown, you end a
> line with two or more spaces, then type return."
>
> http://daringfireball.net/projects/markdown/syntax#p
>
> Jonathan.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



truncating posts with markdown

2007-09-02 Thread Evan H. Carmi

Hi,

I ran across a problem today with the list view of my blog. I am using
markdown to create html tags for my post. In the list view I use the
template tag truncate to cut off the number of words. This leaves open
the html tags that markdown created.

I am wondering what ways people get around this?

Thanks,
Evan

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: web site

2007-09-02 Thread eXt

Yes, Django works with databases very well. Yes, Django has much more
to offer than just interaction with db. Yes, Django has nice and
really helpful community.

No... err..  anybody? ;)

Go through a Django's tutorial you'll find at a documentation section
on Django's home page, and you should be able to ask a more specific
question.

Regards
Jakub Wiśniowski

On 2 Wrz, 19:12, "Alfredo Alessandrini" <[EMAIL PROTECTED]> wrote:
> I'm a newby..:-)
>
> Is Django good for make a web site like this?
>
> http://www.ficgs.com/http://www.chessmail.org/
>
> These are a web site for playing correspondence chess.
>
> The moves are stored with a database, with information about the players,
> tournament, rating, ecc..
>
> Alfredo


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: limit_choices_to has no effect on list_filter?

2007-09-02 Thread patrickk

I already found a patch from 25.2.2007.
Don´t know why it´s not in the trunk yet, but it seems to work.

Patrick

On 2 Sep., 21:27, patrickk <[EMAIL PROTECTED]> wrote:
> I thought this has been working, but I´m not sure:
>
> content_type = models.ForeignKey(ContentType, limit_choices_to =
> {'pk__in': [10, 24, 25, 26, 51]})
> ...
> list_filter = ('createdate', 'updatedate', 'category',
> 'content_type',)
>
> in the filter, alle the content_types show up, although I´ve been
> limiting them with limit_choices_to.
>
> Any suggestions?
>
> Thanks,
> Patrick


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



limit_choices_to has no effect on list_filter?

2007-09-02 Thread patrickk

I thought this has been working, but I´m not sure:

content_type = models.ForeignKey(ContentType, limit_choices_to =
{'pk__in': [10, 24, 25, 26, 51]})
...
list_filter = ('createdate', 'updatedate', 'category',
'content_type',)

in the filter, alle the content_types show up, although I´ve been
limiting them with limit_choices_to.

Any suggestions?

Thanks,
Patrick


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: auth.view.login acting very weird

2007-09-02 Thread jfagnani

Thanks,

That makes sense. I guess could either patch the login view,
AuthenticationForm or call set_test_cookie() on unauthenticated users
on their first page view, probably through middleware.

One odd thing though: I'm using the sample code from the docs in my
login.html template that tests for form.has_errors and then displays
an error message. I tried listing form.errors to see if I could get a
better error message, but form.errors is empty. Looking at the code
for AuthenticationForm and views.login, forms.errors should contain a
validation error complaining about cookies.

-Justin

On Aug 31, 3:47 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 8/31/07, jfagnani <[EMAIL PROTECTED]> wrote:
>
> > I can't figure out what's going on, the form obviously works in some
> > circumstances, and the log-in data is also correct.
>
> You're running into the issue in ticket #3393[1]. I keep meaning to
> put together a better patch, but other things keep coming up with
> higher importance.
>
> [1]http://code.djangoproject.com/ticket/3393
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Another UnicodeError: django-registration or send_mail

2007-09-02 Thread patrickk

With all the UnicodeErrors I got within the last couple of days, I
really regret switching to current trunk.
However, since there´s no step backwards, I´m going to post another
error here:

I´m using django-registration and changed line 80 of models.py from
subject = "Account activation for %s" % current_domain
to
subject = "Account-Aktivierung für %s" % current_domain

which throws an error.

Any help?

Thanks,
Patrick


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Obtain a range of values out of the database

2007-09-02 Thread Ramiro Morales

On 9/2/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
>
> Hi there!
>
> I'd like to obtain a range of possible values out of the database. So,
> if for a certain field, the values in the database are [3,7,5,1,8,12,6],
> I'd like to push those into a dropdown. No problem with the dropdown
> part. But how do I manage to get such a list? And what about sorting it?
>

Take a loot at the values() method:

  http://www.djangoproject.com/documentation/db-api/#values-fields

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



web site

2007-09-02 Thread Alfredo Alessandrini
I'm a newby..:-)

Is Django good for make a web site like this?

http://www.ficgs.com/
http://www.chessmail.org/

These are a web site for playing correspondence chess.

The moves are stored with a database, with information about the players,
tournament, rating, ecc..


Alfredo

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Obtain a range of values out of the database

2007-09-02 Thread Chris Hoeppner

Hi there!

I'd like to obtain a range of possible values out of the database. So,
if for a certain field, the values in the database are [3,7,5,1,8,12,6],
I'd like to push those into a dropdown. No problem with the dropdown
part. But how do I manage to get such a list? And what about sorting it?

Thanks!

~ Chris


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: markdown issue

2007-09-02 Thread Jonathan Buchanan

[EMAIL PROTECTED] wrote:
> i use markdown for beautify content, but i found if enter once, there
> will be no new line.
> i need to enter twice to get a new line (as  )
> 
> how can i get a new line when enter once, you know our user do not
> know they need to enter twice.

"When you do want to insert a  break tag using Markdown, you end a 
line with two or more spaces, then type return."

http://daringfireball.net/projects/markdown/syntax#p

Jonathan.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



markdown issue

2007-09-02 Thread [EMAIL PROTECTED]

i use markdown for beautify content, but i found if enter once, there
will be no new line.
i need to enter twice to get a new line (as  )

how can i get a new line when enter once, you know our user do not
know they need to enter twice.

thx!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



sending mails to users

2007-09-02 Thread T-u-N-i-X

Hey there,

I'm currently developing a Django application.. When the user changes
his/her mail address, an activation mail is sent. It waits until it
sends the email which is not very nice.. So I guess that I should use
threading for that purpose..

Any suggestions for this one ? Can't I start a thread like this:

in a Form:

  def save(self):
...
Thread.start(user.email_user(.))

Because the other way, I should create a class for a thread and send
the mail in that which drives me to pass some arguments to the Thread
class.. I don't have much experience with threading as you see..

Any way, any suggestions, please ?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: deleting a foreign key object deletes all related items

2007-09-02 Thread kan

John,

Thank you. I have taken up your advice and chosen to override the
delete method of people.

regards
suresh.

On Sep 2, 2:38 am, john <[EMAIL PROTECTED]> wrote:
> > advisor.delete() I expect should just delete the advisor object and
> > change p2.advisor and p4.advisor to None but advisor.delete() deletes
> > p2 and p4.
>
> This is the expected behavior, and it's behavior that's required to
> maintain referential integrity in the database. The docs mention it 
> athttp://www.djangoproject.com/documentation/db-api/#deleting-objects:
> "When Django deletes an object, it emulates the behavior of the SQL
> constraint ON DELETE CASCADE - in other words, any objects which had
> foreign keys pointing at the object to be deleted will be deleted
> along with it."
>
> > Is there no way to have an optional relationship to a
> > foreignobject. Ofcourse I can find all related objects for advisor,
> > disconnect them from advisor and then delete the advisor.
>
> This is exactly what you'll have to do. Maybe something like this
> (untested):
>
> for p in Person.objects.filter(advisor=advisor):
> p.advisor = None
> p.save()
> advisor.delete()
>
> You could also override Person's delete() method to make this the
> default behavior.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error from URLs with non-ascii characters and that need login

2007-09-02 Thread web-junkie

Okay, I did that.
http://code.djangoproject.com/ticket/5308

On Aug 14, 11:09 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-08-10 at 05:05 -0700, web-junkie wrote:
> > Okay, after further investigation the error appears for me too, not
> > just googlebot. When I browse the site as anonymous user and click a
> > link with encoded Unicode in URL, and if that links needs login, I get
> > an error.
> > Seems to be a bug in the checklogin decorator.
>
> If you could file a ticket for this, including a short description of
> how to repeat the problem, that would be brilliant. It will mean we
> don't forget to fix it (the volume on this list is too high for us to
> remember which particular pieces of email might or might not have
> mentioned bugs).
>
> Thanks,
> Malcolm
>
> --
> Save the whales. Collect the whole set.http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---