Order of Middleware

2008-11-17 Thread Peter

When I run django admin and do startproject I get a settings file that
has:

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

In the global_settings.py file there is:

# List of middleware classes to use.  Order is important; in the
request phase,
# this middleware classes will be applied in the order given, and in
the
# response phase the middleware will be applied in reverse order.

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.middleware.http.ConditionalGetMiddleware',
# 'django.middleware.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
)

Order is declared to be important so which is the correct order?

--~--~-~--~~~---~--~~
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: Python and/or django book

2008-11-17 Thread Peter

On Nov 17, 7:53 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Just trying to figure out what the best book to purchase for a
> newcomer to Django and python.  Thanks for your suggestions.

I always use Alex Matelli''s Python in a Nutshell (2nd edition now).
You can access that and the Django book
mentioned here using a Safari subscription through DevX for about $9
per month. This is a
good idea to see if you like a book enough to buy it!

Cheers,
Peter
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Access the HTTP request from a model

2008-11-24 Thread Peter

Hi,

I am new to Django so please excuse if this has been asked before - I
could not find anything in my list searches.

I am using the standard admin for a model called Member. I can
override the save method to perform a small database tweak when a
member is saved. This will involve accessing the value of a hidden
field in the change_form for the model which I have added.

Unfortunately I don't seem able to access the HttpRequest object and
hence the POST data that was supplied when the change_form was
submitted.

It seems that this information should be available somewhere - can
anyone tell me how?

Thanks

-- Peter
--~--~-~--~~~---~--~~
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: Access the HTTP request from a model

2008-11-25 Thread Peter

Absolutely - that is exactly what I needed to know. Thanks!  There is
a link
http://www.djangoproject.com/documentation/models/save_delete_hooks/
which I had looked at which actually turns out to be the wrong one.

-- Peter
>
> Take a look at the following 
> doc:http://docs.djangoproject.com/en/dev//ref/contrib/admin/#save-model-s...
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Best way to create a for a subset of a model

2008-12-07 Thread Peter

Say I have model with many fields but I want to present a form to edit
just a subset of these. The ModelForm class makes preparing a form for
a whole model v. easy - somehow it seems there will be a neat way for
doing this but I have not been able to find one. Is there such?

Thanks,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to create a for a subset of a model

2008-12-07 Thread Peter



On Dec 7, 1:53 pm, "Valts Mazurs" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Please take a closer look at ModelForm 
> documentation:http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a...
>
> Best regards,
> --
> Valts

Thanks a lot - that works. I tried it before but it didn't, but I must
have screwed up somehow!

-- Peter

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Restricting add in the admin

2008-12-19 Thread Peter

I have two models in my app - one is standard in that it allows
changing existing records/instances and adding new ones. But the other
- actually a FrontPage model - does not permit adding another
instance. There are ways to do this but I am wondering if there is a
standard way as it seems a common use-case. I am still pretty new to
Django so excuse if this is a FAQ.

-- Peter
--~--~-~--~~~---~--~~
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: Restricting add in the admin

2008-12-19 Thread Peter


>
> You could make such a check and deny the saving of a new FrontPage
> object by overloading the save() method of class FrontPage.
> Source in trunk: django/db/models/base.py.
>
> Regards, James.

Thanks James.

Yes - I see that would work - but it involves coding and I was looking
for a more 'declarative'
way.

After posting I thought of the following (WHY is it always AFTER
posting??).

I'll give the user permission to change a FrontPage instance but not
delete or add one. The real admin user
will have just to avoid adding / deleting but this user ain't used
(much). In the FrontPage view I can check
that the original view is being used (perhaps by looking for pk==1 or
something).   The main thing is that this
switches off the admin template buttons 'x delete' '+add' etc.

What I was looking for was a global permission that could be set on a
model when it was defined which set
default permissions for 'staff' on the model (or even for superuser)
on that model.

Regards, Peter


--~--~-~--~~~---~--~~
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: Restricting add in the admin

2008-12-19 Thread Peter

>
> >  What I was looking for was a global permission that could be set on a
> >  model when it was defined which set
> >  default permissions for 'staff' on the model (or even for superuser)
> >  on that model.
>
> Why not just create another group?

Because being a singleton (and not removable) should be, I think, an
*attribute* of the
class/model not of  a particular user or a group.

Cheers, Peter
--~--~-~--~~~---~--~~
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: Restricting add in the admin

2008-12-20 Thread Peter



On Dec 20, 1:03 pm, felix  wrote:
> just a thought:
>
> you might consider allowing multiple front page objects and having a way to
> select the current one.
> this could come in handy to switch what is currently the front page (or to
> audition the new front page).
>

Yes - perhaps add a Boolean field (not shown in the admin)
'is_active'

Thanks, Peter
--~--~-~--~~~---~--~~
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: Restricting add in the admin

2008-12-20 Thread Peter


> Very relevant, don't forgot to overload the save method to set
> other is_active to 0!
>
> Regards, James.

Ah - yes that would seem a good idea :-).

P.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter

I have two models: Person and Telephone. A person can have many
telephones but a telephone belongs to at most one person. The models
are:

class Person(models.Model):
name = models.CharField(max_length=50)

def __unicode__(self):
return self.name

class Telephone(models.Model):
phone_number = models.IntegerField()
phone_type = models.CharField(max_length=50, blank=False)
owner = models.ForeignKey(Person, blank=True, null=True)
ordering = ['+phone_number',]

def __unicode__(self):
return unicode(self.phone_number)

In admin.py I have:

class TelephoneInline(admin.TabularInline):
model = Telephone

class PersonAdmin(admin.ModelAdmin):
inlines = [TelephoneInline,]
fk_name='owner'
admin.site.register(Person, PersonAdmin)

Using PostgreSQL this allows me a single phone number for a person. I
can chnage and delete the number. However if I add more than one phone
number I cannot change or delete numbers.

Changing from PostgreSQL to MySQL this issue disappears.

There is no useful error information I can access (just the default
ValidationError). Has anyone any idea what this might be?

-- Peter


--~--~-~--~~~---~--~~
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: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter

Thank you Ana, I checked that out - but I don't understand how it
works (at least not without looking at the
other models).

Is Django less solid with Django than MySQL?  I mean my example is a
trivial 'text book' example
and it did not work with PostgreSQL

-- Peter

On Dec 30, 6:49 pm, Ana  wrote:
> Hello Peter,
>
> I use Postgres and have success creating a manytomany table.  See:
>
> http://dpaste.com/103824/
>
> Ana
>
> On Dec 30, 10:29 am, Peter  wrote:
>



--~--~-~--~~~---~--~~
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: Inline problem in Postgres but not MySQL

2008-12-30 Thread Peter


> (You don't say what version of Django you are using.)

Sorry - 1.0 final

> What you describe
> sounds similar to a few problems that have been reported.

Ah yes. I looked. Thanks. Nasty.

> but I believe the only way to
> completely ensure you do not see this issue with PostgreSQL at present is to
> include a default ordering for your inlined model.

Well I have updated to 1.1 pre-alpha SVN-9692' and the issue has been
fixed. You say to
include a default ordering "for your inlined model". Can you show me
on the model I supplied
how I should do this. It does include an ordering already but I
presume not the right one?

Thanks for yur help here - an amazing list this.

-- Peter


>
> 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: Inline problem in Postgres but not MySQL

2008-12-31 Thread Peter

I just installed 1.0.2 final and the bug has been fixed in that.

-- Peter
--~--~-~--~~~---~--~~
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: Installing Django 1.0.2...

2008-12-31 Thread Peter

Python cannot find django/utils/version.py. Usually everything needed
for
to run django (which is everything in the 'django' folder) is put
under the folder 'site-packages'
in your pythin installation. AFAIK simply copying C:\Django-1.0.2-final
\django to site-packages\django
should work.

-- Peter

On Dec 31, 8:46 am, mic  wrote:
> I am a first time python/django user..
>
> Running "python setup.py install" from django-1.0.2-final directory
> gives me this error
>
> Traceback (most recent call last):
>   File "setup.py", line 69, in 
>     version = __import__('django').get_version()
>   File "C:\Django-1.0.2-final\django\__init__.py", line 13, in
> get_version
>     from django.utils.version import get_svn_revision
> ImportError: No module named utils.version
>
> Any ideas on what I am missing?
>
> Thanks
>
> Mic
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Validating imported data

2009-01-12 Thread Peter

Hello,

I'm trying to build an application with django that supports data
import from a CSV. The problem that I'm having is validating the data.
I know how to validate data that comes from a form.

However, in my case the user is using a CSV file for imput instead a
form. Is there a way that I can validate the data without using a
form? Or is there I can interface with the form validation with using
a form?

Thanks,

~Peter

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Date from django to form and back again.

2008-09-29 Thread Peter

Hi folks,
  I want to check a form when it submitted to see whether it contains
an input called 'lastUpdate'

  If lastUpdate is blank I want to populate it with the current time
(preferably as the number of milliseconds since 1970 so js can load it
easily, date:"U" seems to cover it)

  If it isn't blank I want to use it's value to create a date in
django.  This is the bit that is giving me grief.

  I know it's gotta be ultra simple but I haven't found it.

Cheers,
Peter

--~--~-~--~~~---~--~~
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: Date from django to form and back again.

2008-09-30 Thread Peter

fromtimestamp is exactly the ticket.

Thanks!

On Sep 30, 6:16 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-09-29 at 14:08 -0700, Peter wrote:
> > Hi folks,
> >   I want to check a form when it submitted to see whether it contains
> > an input called 'lastUpdate'
>
> >   If lastUpdate is blank I want to populate it with the current time
> > (preferably as the number of milliseconds since 1970 so js can load it
> > easily, date:"U" seems to cover it)
>
> >   If it isn't blank I want to use it's value to create a date in
> > django.  This is the bit that is giving me grief.
>
> Python's standard library function datetime.datetime.fromtimestamp()
> will do what you want.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Opera File Upload Issue

2009-03-30 Thread Peter

I'm having an opera file upload issue, which may not be django's
fault, but I'm curious if anyone has seen it (and has a solution)...

When I upload an image *only in opera* (specifically 9.64 on mac osx)
it doesn't appear in request.FILES.  However, if I upload a really
small image 8kb, it works.  Same problem as this post:
http://groups.google.com/group/django-users/browse_thread/thread/eecc7d6ae0af478a/bf6f834ceba881fa?lnk=gst&q=opera+upload#bf6f834ceba881fa
(which no one has responded to)

The only other thing that I could find on the internet that might
refer to this was from this thread (in 2001!):
http://list.opera.com/pipermail/opera-users/2001-June/004854.html  I'm
currently running a very standard version of apache.

If anyone else has encountered and solved this problem your input
would be greatly appreciated!

(also, yes the form has the proper enctype and the upload field is
just rendered directly by the django form resulting in )
--~--~-~--~~~---~--~~
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 fastcgi randomly raising OperationalError

2009-04-21 Thread Peter
cations of a change like that.

A related question:  When I use django.db.connection.cursor() am I
supposed to call close() myself when I am done?  Right now I don't
call close anywhere.

Any pointers, suggestions, or solutions would be tremendously
appreciated. The site is going live on a couple weeks and if I can't
get to the bottom of this I will probably switch to using Apache and
mod_wsgi.

Thanks,

Peter



On Mar 23, 8:57 pm, Malcolm Tredinnick 
wrote:
> On Mon, 2009-03-23 at 12:11 -0700, PeterSheatswrote:
>
> [...]
>
> > The error I was getting before was just a "connection already closed
> > error" until I changed the following in wsgi.py line 235-248:
>
> Well, that's really the more important issue, then. Why is the
> connection already closed when Django expects it to already be opened.
> You need to investigate that problem a bit more, I think. It's related
> to the error you get when you change things (since the attempt to close
> off the savepoint will be causing a new connection to be opened, which
> will have a different transaction status, etc -- it's all a consequence
> of the first problem).
>
> 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
-~--~~~~--~~--~--~---



how to change database within Django.

2009-04-30 Thread peter

Hello,
  I'm an newbie so please bear with me.

  I have a simple form that a user can select the from different
product line (databases) and search based on serial number.  From what
I have read, the database name needs to be specified within Django,
which in this case is a dynamic variable.  How can I get around this
dealing with multiple database search problem?

Thanks,
-Peter


--~--~-~--~~~---~--~~
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 change database within Django.

2009-04-30 Thread peter

Hi,
  We have a database for each product that we have.  Within the
database, there are product specific tables.  The current setup uses
PHP/MySQL and the front end is a simple form that a user can use to
select which product they want to do a search on, follow by a serial
number.  I'm _very_ surprised that Django can't switch databases to do
simple queries.  I have gone and digged around this group and found
this thread.

http://groups.google.com/group/django-developers/browse_thread/thread/9f0353fe0682b73

Frankly, this is a little to much hassle for my taste...if there isn't
an easier way to do this, then I will have to think of another
framework alternative...perhaps RoR.

-peter

On Apr 30, 12:54 pm, Daniel Roseman 
wrote:
> On Apr 30, 6:45 pm, peter  wrote:
>
> > Hello,
> >   I'm an newbie so please bear with me.
>
> >   I have a simple form that a user can select the from different
> > product line (databases) and search based on serial number.  From what
> > I have read, the database name needs to be specified within Django,
> > which in this case is a dynamic variable.  How can I get around this
> > dealing with multiple database search problem?
>
> > Thanks,
> > -Peter
>
> Django can't currently switch between databases - there is a Summer of
> Code project this year to make it possible - but I wonder if you
> really need it.
>
> I suspect you are confused about what a database consists of. A
> database is a collection of tables, and individual databases are
> usually quite separate from one another. While I don't know the
> details of your setup, it seems unlikely that you would have multiple
> databases for different product lines - in fact I wouldn't even have
> separate sets of tables, the best way would be to have one table
> containing the product line codes and one with the individual
> products, with a foreign key to the product lines table.
>
> Can you give more details of your setup - is this a legacy database?
> --
> 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
-~--~~~~--~~--~--~---



MySQLdb (python 2.6/django from subversion)

2009-12-04 Thread Peter
Hi,

I've installed django on an XP box and am trying to work through the
tutorial.

I got django from svn using the url from the django site:

http://code.djangoproject.com/svn/django/trunk

All is well until I try to do syncdb, at which point I get an error
message:

Error loading MySQLdb module: DLL load failed: The specified module
could not be found

I get the same if I try to import the module from the python prompt,
as well.

MySQLdb is installed at: C:\Python26\Lib\site-packages\MySQLdb

settings.py says:

DATABASE_ENGINE = 'mysql'   # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'mysite' # Or path to database file if
using sqlite3.
DATABASE_USER = 'django' # Not used with sqlite3.
DATABASE_PASSWORD = '...' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

The Windows path environment variable includes;

... C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Python26;C:
\Python26\Lib\site-packages;C:\Python26\Lib\site-packages\django\bin;C:
\Python26\Lib\site-packages\MySQLdb

I've googled, and searched the archives here, but haven't found a
solution (although I have found others with similar problems)

If this would be better on another list, please let me know which one
and I'll post there.  I wasn't sure if I should post here or on a more
general python list.

Cheers


Peter

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




"Error: cannot import name comments" during syncdb

2010-04-20 Thread Peter
Hi All, this is my first post so be gentle...

I am getting the error, "Error: cannot import name comments" during
syncdb and validate.  There's no traceback, just the above error
message, in red!  I've the comments system in my apps for a while now,
so that's not something new that would have caused the problem to
suddenly start occurring.

I'm suspecting differing behaviour between versions of Django, as I am
running 1.1.1 on my laptop and the problem does not occur there; I am
also running 1.1.1 on the hosting site (djangohosting.ch) for the
production version, however the tools and development server are "1.2
beta 1 SVN-13002", so I'm actually suspecting a bug or a change of
behaviour between 1.1.1 and 1.2 beta 1.

Does anyone know of any changes between those two versions that would
cause this effect?

I'll supply (a large chunk of) my settings.py at the bottom of this
email. (I've just started trying to integrate Paypal, but that code is
commented out and the problem arose before I started doing that, so
I'd say that's a red herring.)

Thanks in advance,

Peter


settings.py:

# -*- coding: utf-8 -*-
# Django settings for ductedit project.

import os.path

BASE_PATH = os.path.dirname(__file__)

DEBUG = True
TEMPLATE_DEBUG = DEBUG

SERVER_EMAIL = 'pe...@xxx.com'

ADMINS = (
(u'Peter Cassidy', 'pe...@xxx.com'),
)

MANAGERS = ADMINS

SEND_BROKEN_LINK_EMAILS = True

DATABASE_ENGINE = 'mysql'   # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file
if using sqlite3.
DATABASE_USER = 'xx' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be avilable on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'Australia/Adelaide'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-au'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = BASE_PATH+'/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/media/admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'x'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)

ROOT_URLCONF = 'ductedit.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
BASE_PATH+'/templates/',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.comments',
#'django.contrib.syndication',
'django.contrib.flatpages',
'django.contrib.markup',
'ductedit.accounts'

Variable-length forms

2010-05-03 Thread Peter
Forgive the newbie question but I can't see anything in the docco on
this: how do I create a form with a variable number of fields?

The scenario is a situation where the user can buy a variable number
of licences, and needs to enter information for each.  Most of the
information, product, email address etc. is common for all licences
and I only want them to have to type that in once, whereas a couple of
fields: licence name, computer ident info, etc. vary per licence; so
the latter fields have to be typed in one per licence.

What's the best way of doing this?  Can I do it on one page?  Or do I
have to use the Form Wizard with a variable number of steps?  Is that
even possible?

Thanks for any help you can give,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Variable-length forms

2010-05-05 Thread Peter
Thanks.  I'd totally misread what that page was about.  Now I see it's
basically what I want.

Cheers.

On May 4, 9:02 am, Shawn Milochik  wrote:
> http://docs.djangoproject.com/en/1.1/topics/forms/formsets/
>
> That ought to help out.
>
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Job opportunity - Newcastle, NSW, Australia

2010-02-21 Thread Peter
Hi all

Please see:

http://tinyurl.com/djangojob

for a job being advertised by NSW Rural Doctors Network in Newcastle,
NSW, Australia.

Thanks.

Peter J Williams
Information Manager
NSW Rural Doctors Network
Head Office
Suite 19, Level 3
133 King Street
Newcastle NSW 2300
Telephone: (02) 4924-8000
Facsimile: (02) 4924-8010
Mailto:pwilli...@nswrdn.com.au
Web: http://www.nswrdn.com.au

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



delayed_loader and psyco: IndexError issue

2008-02-11 Thread Peter

I'm having the same issue as seen in this post:
http://groups.google.com/group/django-users/browse_thread/thread/4eb598a52fee2d14/49cd8b7eae6bd72e?lnk=gst&q=delayed_loader

I'm getting an IndexError: "list index out of range" in
delayed_loader.py when it tries to make the call:

 caller = traceback.extract_stack(limit=2)[0][2]  (on line 35)

This happens in a view when I'm calling "return
render_to_response(...)", where the view imports another file that is
using psyco.

When I catch the error and look at str(traceback.extract_stack()), I
get "[]"

When I turn off psyco, I do not get the error.

Also, I'm currently using Django revision: 6398

Does anyone know if there is a work around to this, or if it has been
handled in a newer django update?

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Template Question - What if...

2008-02-11 Thread Peter

I have a bunch of widgets that I access dynamically and they render
their own parts of a page.  I would like to give these widgets the
ability to use templates.  Furthermore, these are not installed apps,
so I do not have access to the
"django.template.loaders.app_directories.load_template_source" loader
type.

So the widgets are like this:

project/
  |_widgets/
   |_widget1/
   |_widget2/

I initially decided to just make a templates directory in this
"widgets" folder where each widget could add its own folder of
templates -- sounds reasonable.

However, I'm curious about... What if I let these widgets put
templates directly in their own folders and I declare that project/
widgets is a template directory?  This seems a bit blasphemous, but
ideologies aside -- are there computational issues with this approach
(e.g. longer search for resolving templates, strange conflicts?)

--~--~-~--~~~---~--~~
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: Template Question - What if...

2008-02-12 Thread Peter

Cool, thanks for the tip.

I took your latter suggestion and below is a rewrite of the
django.template.loader.get_template method.  The only additional
requirement is the FS_DIR constant that I import from my settings file
(which I was already using in settings.py to clean up my TEMPLATE_DIR
path declarations).

def get_template(template_name, widget_name):
from django.conf import settings
return _get_template(template_name, dirs=[settings.FS_DIR +
'widgets/' + str(widget_name)])

def _get_template(template_name, dirs=None):
 
'''
Returns a compiled Template object for the given template
name,
handling template inheritance
recursively.

The dirs argument is a list of directory
paths
'''
from django.template.loader import find_template_source,
get_template_from_string

source, origin = find_template_source(template_name, dirs)
template = get_template_from_string(source, origin, template_name)
return template


On Feb 12, 12:26 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-02-11 at 16:55 -0800, Peter wrote:
> > I have a bunch of widgets that I access dynamically and they render
> > their own parts of a page.  I would like to give these widgets the
> > ability to use templates.  Furthermore, these are not installed apps,
> > so I do not have access to the
> > "django.template.loaders.app_directories.load_template_source" loader
> > type.
>
> > So the widgets are like this:
>
> > project/
> >   |_widgets/
> >|_widget1/
> >|_widget2/
>
> > I initially decided to just make a templates directory in this
> > "widgets" folder where each widget could add its own folder of
> > templates -- sounds reasonable.
>
> > However, I'm curious about... WhatifI let these widgets put
> > templates directly in their own folders and I declare that project/
> > widgets is atemplatedirectory?  This seems a bit blasphemous, but
> > ideologies aside -- are there computational issues with this approach
> > (e.g. longer search for resolving templates, strange conflicts?)
>
> Just do it. There's no problem here. TEMPLATE_DIRECTORIES is just a list
> of directories that is searched by the filesystem loader for files that
> match the name you want to load. So the only drawback is that those
> directories are searched every time you load atemplate. Might be an
> issue, might not be.
>
> Alternatively,ifyou want to super-efficient and tricky, your widgets
> could load theirtemplatestrings manually: you can pass a "dirs"
> argument to the find_template_source() function, so you could manually
> alter the directories to search when loading the templates. Using a
> combination of find_template_source() and get_template_from_string(),
> just as get_template() does, means you can create aTemplateobject
> instance, loading the source from a restricted, custom set of
> directories. Have a poke around in django/templates/loader.py for
> details.
>
> Regards,
> Malcolm
>
> --
> The only substitute for good manners is fast 
> reflexes.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
-~--~~~~--~~--~--~---



Re: File Upload, form issue

2008-05-02 Thread Peter

It's probably one of two things:

1. You might be pointing to the wrong template, load the page in your
browser and hit view source to ensure that your form is indeed doing
enctype="multipart/form-data", and that whatever url you're pointing
to for the action attribute is blank or for debugging, try hardcoding
the correct url.

2. Some guy in another thread claimed that changing "enctype" to
"ENCTYPE" fixed his issue... but that's hearsay on my part.

On Apr 16, 1:48 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 16, 2008 at 11:39 AM, sparky <[EMAIL PROTECTED]> wrote:
>
> > Thank you for your help.
>
> > I'm baffled. The validation error is:
>
> > contentThis field
> > is required.
>
> > which is fair enough... but it is in the form and I've selected a
> > file, clicked open, and clicked submit...
>
> I've never seen that behavior.  I assume you've tried different files,
> different browsers, etc.?  Is there anything in your setup that would limit
> request bodies to something smaller than the size of the file you are trying
> to upload (I believe apache has a parameter for this but I thought you would
> get an error, not silent dropping of the file data, if you ran into it)?  If
> request.FILES is empty immediately upon entry to your view then it is
> something outside of the code you have posted that is causing that, but I
> have no idea what.
>
> Karen
>
> > I'm probably doing something mind-meltingly stupid.
>
> > hmmm.
>
> > Glad the rest of it seems ok, though.
>
> > On Apr 16, 1:41 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Wed, Apr 16, 2008 at 6:55 AM, sparky <[EMAIL PROTECTED]> wrote:
>
> > > > Hello all,
>
> > > > I have a slightly unusual requirement: I want to use a FileField in a
> > > > form but with a TextField in the model. (The content being uploaded is
> > > > a big bit of flat text, but I want to store it in the database, not as
> > > > a file.)
>
> > > > The problem is that with the code that I have together the
> > > > request.FILES parameter is empty, so the form fails validation, any
> > > > suggestions as to where I'm going wrong, thanks.
>
> > > I do not see any reason why what you have posted below would fail form
> > > validation.  request.FILES will be populated, assuming you actually
> > choose a
> > > file before you click "Submit".  Are you really seeing a problem with
> > form
> > > validation failing?  If so, what exactly is the validation error message
> > ?
> > > "This field is required." or "The submitted file is empty" or ...?
>
> > > The problem I do see in your code below is that you do not put the
> > content
> > > of the uploaded file in your model as you state you want to.  When your
> > form
> > > is validated, cleaned_data['content'] will be an UploadedFile.  If you
> > want
> > > to access the content of the UploadedFile, you need to use
> > > cleaned_data['content'].content.  As you have coded it below I believe
> > you
> > > will get the name of your uploaded file put into your model's content
> > field.
>
> > > Karen
>
> > > > sparky
>
> > > > the form:
> > > > class SubmissionForm(forms.Form):
> > > >title = forms.CharField(max_length=100)
> > > >description = forms.CharField(widget=forms.Textarea)
> > > >content = forms.FileField(widget=forms.FileInput)
>
> > > > the model:
>
> > > > class Submission(models.Model):
> > > >"""
> > > >Submission model
> > > >"""
> > > >creator = models.ForeignKey(User)
> > > >created_datetime  = models.DateTimeField(auto_now_add=True)
> > > >title = models.CharField(max_length=100)
> > > >description = models.TextField()
> > > >content = models.TextField()
>
> > > > The view code:
> > > >if request.method == 'POST':
> > > >form = SubmissionForm(request.POST, request.FILES)
> > > >if form.is_valid():
> > > >s = Submission(creator=request.user,
> > > >created_datetime=datetime.datetime.now(),
> > > >title=form.cleaned_data['title'],
> > > >description=form.cleaned_data['description'],
> > > >content=form.cleaned_data['content'])
>
> > > > the template:
>
> > > >
> > > >
> > > >{{ form.as_p }}
> > > >
> > > >
> > > >
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Admin panel question

2008-05-25 Thread peter

Hello everyone. I've just begin my adventure with Django, and I have
some problems. I want to add some custom functions to admin site. For
example, I want to add method from not model class, which sends email
to specify users, or something similar. Is it possible? Where I can
find information 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Creating a request object + middleware benefits

2008-05-29 Thread Peter

I'm looking for a quick and simple way to create a request object - as
it would be received by a specific view - for some very basic
testing.  Additionally, I want this object to have all the added
attributes from the middleware modules e.g. request.user.

I tried this:

(1)
I looked at django.http.HttpRequest.  Easy to construct, but (based on
what I saw in django.core.handlers.base.py) it requires manually
looping through the middleware.  Also, it requires special work of
managing cookies to perform a login.

(2)
I looked at the test code - django.test.client.Client - which makes
building a request much easier and handles the login.  However, I'm
not running django's test runner and I do not plan on using it for
this case - which means I lose the "black magic" that pulls context
variables - so when I get a response, I cannot grab the HttpRequest
object - just the dict that gets stored as response.request.  Is there
a reason why the HttpRequest object isn't added?

I performed a little hack around this by modifying the test Client
code to add the request as an attribute to the response before it is
returned.

django/test/client.py L38
request = WSGIRequest(environ)
response = self.get_response(request)
response.d_request = request # modified line

This works with the two shortcomings (1) I had to hack the source code
to get the value and (2) I'd prefer if I could grab this object
*without actually making the request*, which may modify my underlying
database.

Does anyone know a solution to this (apart from extending BaseHandler,
rewriting the get_response method, and then performing some more
modifications to a new class that would extends test.Client --
hopefully I'm missing something more obvious here...)?  Any help would
be greatly 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
-~--~~~~--~~--~--~---



using only database part of Django

2008-06-26 Thread Peter

Hello.

I want to use Django database API without using other parts of Django
(views, templates etc).

What is the most correct way of doing that?

Of course, I can create a new project with an empty template and view,
but it will look bad, cause there will be a lot of needless files in
my projects.

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



connection.queries - show improper SQL?

2008-07-08 Thread Peter

When I look at generated sql from connection.queries, it doesn't show
any quotes around strings.

For example:
>>> from django.db import connection
>>> from django.contrib.auth.models import User
>>> User.objects.filter(username="bob")
[]
>>> connection.queries[-1]
{'time': '0.000', 'sql': u'SELECT `auth_user`.`id`,
`auth_user`.`username`, `auth_user`.`first_name`,
`auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`,
`auth_user`.`is_staff`, `auth_user`.`is_active`,
`auth_user`.`is_superuser`, `auth_user`.`last_login`,
`auth_user`.`date_joined` FROM `auth_user` WHERE
`auth_user`.`username` = bob  ORDER BY `auth_user`.`username` ASC'}
>>>

As one would imagine, when I execute:

mysql> SELECT `auth_user`.`id`, `auth_user`.`username`,
`auth_user`.`first_name`, `auth_user`.`last_name`,
`auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`,
`auth_user`.`is_active`, `auth_user`.`is_superuser`,
`auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user`
WHERE `auth_user`.`username` = bob  ORDER BY `auth_user`.`username`
ASC;

It complains with "Unknown column 'bob' in 'where clause'".

It's obvious how I would change that code to execute properly, but I'd
like to know exactly what query django is building.
(for example you can get away with passing a number into a query
against a varchar, and that can affect the efficiency of complex
queries)

Is this Django-MySQL 5.x specific?  Is this a full-on django bug?

Regards.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



connection.queries - show improper SQL?

2008-07-08 Thread Peter

When I look at generated sql from connection.queries, it doesn't show
any quotes around strings.

For example:
>>> from django.db import connection
>>> from django.contrib.auth.models import User
>>> User.objects.filter(username="bob")
[]
>>> connection.queries[-1]
{'time': '0.000', 'sql': u'SELECT `auth_user`.`id`,
`auth_user`.`username`, `auth_user`.`first_name`,
`auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`,
`auth_user`.`is_staff`, `auth_user`.`is_active`,
`auth_user`.`is_superuser`, `auth_user`.`last_login`,
`auth_user`.`date_joined` FROM `auth_user` WHERE
`auth_user`.`username` = bob  ORDER BY `auth_user`.`username` ASC'}
>>>

As one would imagine, when I execute:

mysql> SELECT `auth_user`.`id`, `auth_user`.`username`,
`auth_user`.`first_name`, `auth_user`.`last_name`,
`auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`,
`auth_user`.`is_active`, `auth_user`.`is_superuser`,
`auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user`
WHERE `auth_user`.`username` = bob  ORDER BY `auth_user`.`username`
ASC;

It complains with "Unknown column 'bob' in 'where clause'".

It's obvious how I would change that code to execute properly, but I'd
like to know exactly what query django is building.
(for example you can get away with passing a number into a query
against a varchar, and that can affect the efficiency of complex
queries)

Is this Django-MySQL 5.x specific?  Is this a full-on django bug?

Regards.
Peter
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Table Locks with Django? (MyISAM)

2007-10-30 Thread Peter

Is there any way to do a table lock through the django database api?
I can't find information on it anywhere.

Hi all,

I'm using MySQL MyISAM tables, which means transactions don't work --
but they do support table locks.  If not directly through the django
api, is there some hybrid of raw SQL and django models that I use to
achieve this?

I tried writing generic lock tables and unlock tables methods, as
such:

-
def lock_tables(connection, args):
 
'''
Performs a table lock with the given connection, args is a
list of tuples
with (, )
**Remember to call unlock_tables at some point after this
call
'''
cursor = connection.cursor()
tbl_clause = [MySQLdb.escape_string(x[0] + " " + x[1]) for x in
args]
cursor.execute("LOCK TABLES %s" % MySQLdb.escape_string(',
'.join(tbl_clause)))

def unlock_tables(connection):
 
'''
Unlocks all table locks for the given
connection
'''
cursor = connection.cursor()
cursor.execute("UNLOCK TABLES")
-

I used these around calls that read and modify the database -- I got
connection using "from django.db import connection" inline in the
method and the args were a write lock on the table I was editing with
read locks on its foreign keys.

This worked in the trivial case of one user in the django python
shell.

However, when I tried to load a page that tried to read the table -
while it was still write locked - the page was not returning (as I
would expect), so I unlocked the tables from within the python shell
and then I received an OperationalError suggesting that the browser
view had screwed up locks (even though there was nothing in the view
code that called the locking methods - maybe this was middleware?) --
"Table '' was not locked with LOCK TABLES"

Is this approach fatally flawed -- does django.db import connection
return only one globally unique connection in django?

Does anyone have any ideas on how this may be possible... if not I
guess I'll move on and start using a transactional database like
innodb

Regards.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



MyISAM table locking.

2007-11-06 Thread Peter

Hi All,

I tried writing some code to do table locking on a MySQL MyISAM
database.  I used the code below, which seemed to work in basic
examples, but the code would complain of accessing a non-locked table
whenever I made a more complex query such as
objects.filter(__) saying
that the table __ wasn't
locked with "LOCK TABLES", even though I had locked the table for the
foreign key.  Furthermore, it failed to lock if I tried to reference
the table using the syntax of the form of the complex query.

Has anyone had success running table locks?

The code:  (note: I was getting connection using: from django.db
import connection)


 def lock_tables(connection, args):
 
'''
Performs a table lock with the given connection, args is a
list of tuples
with (, )
**Remember to call unlock_tables at some point after this
call
'''
if not len(args):
raise Exception("Must supply args to lock table!")
cursor = connection.cursor()
try:
tbl_clause = [MySQLdb.escape_string(x[0] + " " + x[1]) for x
in args]
except:
raise Exception("Args was improperly constructed")
cursor.execute("LOCK TABLES %s" % MySQLdb.escape_string(',
'.join(tbl_clause)))

def unlock_tables(connection):
 
'''
Unlocks all table locks for the given
connection
'''
cursor = connection.cursor()
cursor.execute("UNLOCK TABLES")


--~--~-~--~~~---~--~~
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: MyISAM table locking.

2007-11-06 Thread Peter

Very nice, thanks for the detailed response!

-Peter

On Nov 6, 12:53 pm, Karen Tracey <[EMAIL PROTECTED]> wrote:
> At 10:40 AM 11/6/2007, you wrote:
>
> >Hi All,
>
> >I tried writing some code to do table locking on a MySQL MyISAM
> >database.  I used the code below, which seemed to work in basic
> >examples, but the code would complain of accessing a non-locked table
> >whenever I made a more complex query such as
> >objects.filter(__) saying
> >that the table __ wasn't
> >locked with "LOCK TABLES", even though I had locked the table for the
> >foreign key.  Furthermore, it failed to lock if I tried to reference
> >the table using the syntax of the form of the complex query.
>
> >Has anyone had success running table locks?
>
> Yes, I can get this to work, but it requires knowing exactly how
> Django is going to construct the queries -- what tables will be
> listed and what aliases used.  That means code you get to work now
> may easily break in the future if Django changes how it builds
> queries.  I would not be at all surprised if code that works today
> for this breaks when queryset-refactor lands on the trunk.  But, if
> you really need to make this work, it can be done.
>
> Note that when an alias is used, you must use "real_table AS alias
> lock_type" in the LOCK TABLES statement.
>
> Here's an annotated transcript of how I got lock tables with a
> non-trivial query to work with my DB.  Where I displayed the sql for
> the query I manually split the lines to highlight the tables involved
> in the query.  (Note my database existed before I ever started using
> Django so the tables and column names are not what you might expect
> for a Django DB.)
>
> --
>
>  >>> # Contstruct a query to get a list of Clues in the DB for the
> Entry "DJANGOREINHARDT"
>  >>> cl =
> Clues.objects.select_related().filter(EntryID__Entry='DJANGOREINHARDT')
>
>  >>> # Naively assume the only table we need to lock is Clues itself
>  >>> cursor.execute("LOCK TABLES Clues READ")
> 0L
>
>  >>> # See how wrong we are
>  >>> cl
> Traceback (most recent call last):
>File "", line 1, in 
>File "/homedir/django/newforms-admin/django/db/models/query.py",
> line 108, in __repr__
>  return repr(self._get_data())
>File "/homedir/django/newforms-admin/django/db/models/query.py",
> line 482, in _get_data
>  self._result_cache = list(self.iterator())
>File "/homedir/django/newforms-admin/django/db/models/query.py",
> line 189, in iterator
>  cursor.execute("SELECT " + (self._distinct and "DISTINCT " or
> "") + ",".join(select) + sql, params)
>File "/homedir/django/newforms-admin/django/db/backends/util.py",
> line 18, in execute
>  return self.cursor.execute(sql, params)
>File "/var/lib/python-support/python2.5/MySQLdb/cursors.py", line
> 166, in execute
>  self.errorhandler(self, exc, value)
>File "/var/lib/python-support/python2.5/MySQLdb/connections.py",
> line 35, in defaulterrorhandler
>  raise errorclass, errorvalue
> OperationalError: (1100, "Table 'Clues__EntryID' was not locked with
> LOCK TABLES")
>
>  >>> Examine the sql for the last query to see what all really needs
> to be locked
>  >>> connection.queries[-1]['sql']
> u'SELECT `Clues`.`ID`,`Clues`.`Theme`,`Clues`.`Entry
> ID`,`Clues`.`Puzzle
> ID`,`Clues`.`Clue`,`Clues`.`Num`,`Clues`.`Dir`,`Clues`.`Derived`,`Entries`.`Entry
> ID`,`Entries`.`Entry`,`Entries`.`Exclude`,`Puzzles`.`Puzzle
> ID`,`Puzzles`.`Publisher ID`,`Puzzles`.`Date`,`Puzzles`.`Day of
> Week`,`Puzzles`.`Author
> ID`,`Puzzles`.`Title`,`Puzzles`.`Columns`,`Puzzles`.`Rows`,`Puzzles`.`Entry
> Count`,`Puzzles`.`Block Count`,`Puzzles`.`Avg Entry
> Length`,`Puzzles`.`Avg Scrabble Value`,`Puzzles`.`Unused
> Letters`,`Puzzles`.`DateAux`,`Publishers`.`Publisher
> ID`,`Publishers`.`Publisher`,`Publishers`.`Short
> Name`,`Publishers`.`Editor`,`Authors`.`Author
> ID`,`Authors`.`Author`,`Authors`.`Pseudonym`,`Authors`.`Notes`
>
> FROM `Clues`
>
> INNER JOIN `Entries` AS `Clues__EntryID` ON `Clues`.`Entry ID` =
> `Clues__EntryID`.`Entry ID` ,
>
> `Entries`,
>
> `Puzzles`,
>
> `Publishers`,
>
> `Authors`
>
> WHERE ((NOT ((`Clues`.`Derived` = True))) AND
> `Clues__EntryID`.`Entry` = DJANGOREINHARDT) AND `Clues`.`Entry ID` =
> `Entries`.`Entry ID` AND `Clues`.`Puzzle ID` = `Puzzles`.`Puzzle ID`
> AND `Puzzles`.`Publisher ID` = `Publishers`.`Publi

Re: Dynamic ImageField

2007-11-13 Thread Peter

Thanks for posting the example links.

Is there any documentation on "save_file" and what each field actually
is for this method?  I was using some random numbers in the folder
creation and wanted to make sure the folders exist before I save the
file.

Also, is there a big reason to override this vs the _save_FIELD_file
method as shown in this example:
http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html

Regards,
Peter

On Nov 8, 11:26 pm, cschand <[EMAIL PROTECTED]> wrote:
> Hi Marcin
>It's working... Thankyou very much :)
>
> cschand
>
> On Nov 8, 6:46 pm, Marcin Mierzejewski <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
>
> > Yes, you 
> > can:http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic...
>
> > Regards,
> > Marcin
>
> > On Nov 8, 2:08 pm, cschand <[EMAIL PROTECTED]> wrote:
>
> > > Hi all,
> > >   Can we make dynamic ImageFields?uploadfile to /media/avatar/
> > > username or userid/- Hide quoted text -
>
> > - Show quoted text -


--~--~-~--~~~---~--~~
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: Dynamic ImageField

2007-11-13 Thread Peter

No worries, I'm just trying to make sense of all the options. : )

Nonetheless, is there any documentation on what I can get out of each
field in the save_file method, or examples of how I can access the
filename and directory where the file is being saved within this
method?

Marcin's first example works great for me when I check/create the
directory structure before the save and perform resizing after the
save, but I'm having trouble putting these actions into the overridden
method (that whole DRY thing...).  Also, I tried using ideas from the
AutoImageField in Marcin's second example, but my image resizing
seemed to be getting the wrong file_path and failing silently.

For some examples, I wrote a get_upload_to method for dynamic
uploading as such:

  def get_upload_to(self, field_attname):
return 'img/user/%d/%s' % (random.randint(10, 99),
self.id)

and I tried getting the filename within the save_file method as such:

  file_name = os.path.join(settings.MEDIA_ROOT, getattr(new_object,
self.attname))

Thanks for any help!



On Nov 13, 11:30 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Nov 13, 2007 11:03 AM, Peter <[EMAIL PROTECTED]> wrote:
>
> > Also, is there a big reason to override this vs the _save_FIELD_file
> > method as shown in this example:
> >http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-p...
>
> I'll admit, that post was thrown together in a hurry, in response to
> several questions that I kept answering with "it'll be better when my
> filestorage work makes it into trunk". I felt it was better to have
> something out there in the meantime, and I didn't research what
> solutions others had come up with.
>
> In my opinion, the FileField (or ImageField) subclass approach linked
> by Marcin is much simpler and cleaner than my own, and requires much
> less ugly hackery.
>
> That said, this should all get better when my filestorage work makes
> it into trunk. ;)
>
> -Gul


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



django.db.models.Q for OR lookup is having issues with NULL values

2008-01-02 Thread Peter

I am trying to filter by users who are not staff, but this user column
accepts NULL values in my model.

As a result I need to check for user__isnull, since
user__is_staff=False will not work for null values.

I tried:
  Post.objects.filter(Q(user__isnull=True) | Q(user__is_staff=False))
but this returned nothing, while a plain old:
  Post.objects.filter(user__isnull=True)
returns a query set with Post objects.

I tried rewriting this as a NAND:
 
Post.objects.exclude(user__isnull=False).exclude(user__is_staff=True)
but this didn't work either.

Is this a bug?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Value Error during 1.2 to 1.4 conversion

2012-10-07 Thread Peter
I'm trying to convert a Django 1.2 site to a 1.4 site.  So there's lots of 
changing old generic views to class-based generic views, and the apps all 
go up one level so lots of changes to imports, but in each case so far it's 
it's been quite easy to narrow down the problem to a line in my code, and 
fix it.  Until I got to this:

ValueError at / 

dictionary update sequence element #0 has length 1; 2 is required

 Request Method: GET  Request URL: http://www.crompton-saage.com/  Django 
Version: 1.4.1  Exception Type: ValueError  Exception Value: 

dictionary update sequence element #0 has length 1; 2 is required

 Exception Location: 
/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py 
in resolve, line 207  Python Executable: /usr/local/bin/python  Python 
Version: 2.7.3  Python Path: 

['/home/cassidy/webapps/crompton',
 '/home/cassidy/webapps/crompton/crompton',
 '/home/cassidy/webapps/crompton/lib/python2.7',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages/PIL']

 Server time: Sun, 7 Oct 2012 19:03:37 +0800
Request URL: http://www.crompton-saage.com/

Django Version: 1.4.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.comments',
 'django.contrib.flatpages',
 'accounts',
 'machines',
 'sales')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Traceback:
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/handlers/base.py" 
in get_response
  101. request.path_info)
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py" 
in resolve
  300. sub_match = pattern.resolve(new_path)
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py" 
in resolve
  207. kwargs.update(self.default_args)

Exception Type: ValueError at /
Exception Value: dictionary update sequence element #0 has length 1; 2 is 
required

So basically I have have no clue what part of *my* code could be causing 
this as there's no reference to my code.  How would I find out how to trace 
this back to something I can change.  I imagine I can pore through the 
Django sources but I'm not really a Python programmer, I just know enough 
syntax to write Django code.

Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/tr_lPLJq3OsJ.
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: Value Error during 1.2 to 1.4 conversion

2012-10-10 Thread Peter
Thanks. That pointed me in the right direction. First, I didn't realize that 
the 'url' form required named parameters. However, I was using the non-url 
form, and it turned out in the conversion to class-based generics, I had left 
off the "{}" third object in each list. So it was expecting a dictionary and 
getting a string!

Problem solved.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BCYHWOLfpWUJ.
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: LDAP search results "disappear"

2012-12-17 Thread peter

On 12/17/2012 03:58 PM, Kevin Cole wrote:

On Mon, Dec 17, 2012 at 1:57 PM, Kevin Cole  wrote:


And here I'll display my ignorance about threading.  I've done nothing
specific to ask for threading. I wouldn't know how to thread even if I
had a sewing machine. ;-) I'm using apache prefork with mod-wsgi.  In
testing, I go to the URL page first, which I had hoped would set the
global variable like everywhere else that I set values for small
handful of globals, and that going to the autoname URL after that
would see the global I had set.

s/I go to the URL page first/I go to the login page first/

The desing of the view's of django, do not allow you to pass global 
variables between the views. If you want to pass, data between views, 
you need to use ajax, to send the data in a get or post requests.


def index(request):
print 'helou'
return render_to_response('index.html', {'lala': 'lala'})

#index.html
# 
# obj = {type:'get', url='/test/view0', data: {tamangandapio:'yeah'}, type='json',
# response: function (){ console.log(response) }
# }
# $.ajax(obj);
# 

def view0(request)
  #here you see the data send by the jquery code below
  print request.GET
  res = {'success':'i got it'}
  return HttpResponse(simplejson.dumps(res), 
mimetype='application/javascript')



please don't use global variables in views

--
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: Converting Django app into a Desktop app

2012-12-18 Thread peter

On 12/18/2012 04:27 PM, Loai Ghoraba wrote:

@ all thanks for your responses, I will try to investigate them

@Chris: you got me right :) I can use runserver, but it would be too 
light, or make the client install and configure apache (which is not a 
good idea if the client is a normal user, not a programmer).


On Tue, Dec 18, 2012 at 9:23 PM, Chris Cogdon > wrote:


I think what Loai is asking for is a way to "wrap up" the
python/django application, along with a light-weight webserver
(not as light-weight as "runserver" though), so it looks like a
stand-alone application... apart from needing to run a web browser
to connect to it.
eNo module named _tkinter, please install the python-tk package
I, too, am very interested in this.

Just doing some cursory poking around, here's some starting points:

Python Freeze: http://wiki.python.org/moin/Freeze

cx_Freeze: http://cx-freeze.sourceforge.net

Py2Exe: http://wiki.python.org/moin/Py2Exe

py2app: http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html


These handle turning the python program into a stand-alone
executable. It doesn't solve the web-server issue, though. There
are a ton of choices there (eg: gunicorn, twisted, tornado,
web.py) but I have no opinion on which one is going to both
"freeze" well, serve static files well, and work well with Django



On Tuesday, December 18, 2012 8:06:19 AM UTC-8, Loai Ghoraba wrote:

Hi

I am very comfortable with Django, and I was wondering about
whether there is some way to convert a Django web app into a
Desktop app (may be not 100%), so that I can distribute it to
users. May be wrapping it in a light web server "if there is
something like this".

Thanks

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/ruJ-QX6bLO8J.

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.


--
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.
You can use xampp. Create a automatic installer that install xampp and 
django with your app.

Just like Kordi EDMS. http://www.kordil.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Converting Django app into a Desktop app

2012-12-18 Thread peter

On 12/18/2012 05:18 PM, Chris Cogdon wrote:

No Python included with xampp... this makes me sad ;_;


On Tuesday, December 18, 2012 11:43:56 AM UTC-8, peter_julian wrote:

You can use xampp. Create a automatic installer that install xampp
and django with your app.
Just like Kordi EDMS. http://www.kordil.net/.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/KmUdBqv7KZoJ.

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.
Don't realy mathers is xampp comes or not with python, you just need to 
add wsgi module to xampp. and then configure your app to run from

xampp.

--
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: Converting Django app into a Desktop app

2012-12-18 Thread peter

On 12/18/2012 05:18 PM, Chris Cogdon wrote:

No Python included with xampp... this makes me sad ;_;


On Tuesday, December 18, 2012 11:43:56 AM UTC-8, peter_julian wrote:

You can use xampp. Create a automatic installer that install xampp
and django with your app.
Just like Kordi EDMS. http://www.kordil.net/.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/KmUdBqv7KZoJ.

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.

I'm not read the hole article, but the author say 'It works'.

http://www.leonardaustin.com/technical/install-python-and-django-with-xampp-on-windows-7

Is run in windows definitely is going to run on unix :)

--
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 community, is it active?

2012-12-19 Thread peter

Yeah man, we are alive. :).

You wanna be part of us. Don't be afraid, just take a seat, to share, 
implement, etc, etc.



On 12/19/2012 10:32 AM, Tom Christie wrote:
> Is this worth going? --- http://2013.djangocon.eu 



Yes, yes, yes, yes, and yes.  I've been to two DjangoCons, both have 
been incredible, and have reaffirmed how proud I am to work in this 
industry, and to be a part of this community.


> Who are the top blogs people within the Django community who should 
I be following, blogs feed etc.


http://www.planetdjango.org/ is an aggregated news feed for Django posts.

Some folks who write regularly...

Daniel Greenfeld (aka pydanny) - http://pydanny.com/
Reinout van Rees - http://reinout.vanrees.org/weblog/
Nick Coghlan - http://www.boredomandlaziness.org/

If you haven't already I'd recommend getting yourself tapped into 
twitter and follow some of the core devs and other python/django folks.


Also, a tip - I'd stay well away from the free bear.
Might look cute at first, but man, those things can get vicious.
The free beer however, does come recommended.

Cheers,

  Tom

On Wednesday, 19 December 2012 13:02:12 UTC, Cal Leeming [Simplicity 
Media Ltd] wrote:


Sorry, slightly misworded!

Don't /just/ drink the free bear, help out as well.

Cal

On Wed, Dec 19, 2012 at 3:02 AM, Chris Cogdon > wrote:

But I _want_ to drink the free bear.

On Tuesday, December 18, 2012 3:19:59 PM UTC-8, Cal Leeming
[Simplicity Media Ltd] wrote:

 Don't drink the free bear though, ...



-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/Je-VbEdMmoQJ
.

To post to this group, send email to
django...@googlegroups.com .
To unsubscribe from this group, send email to
django-users...@googlegroups.com .
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
.


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pVVzxQCEmdwJ.

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.


--
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 community, is it active?

2012-12-20 Thread peter

On 12/19/2012 07:09 PM, Glyn Jackson wrote:

@Odagi

point well made. thanks for everyone for being so welcoming :0 I spent 
today building my first Django local site,
ended up with 4 apps. taken me awhile to get my head around things i 
ended up with


registration
  - handles my user signed
security
 - login, logout
web
 - flat pages etc
- rewards
 - a simple api link to an existing platform in java

given this was my first time really playing with the framework, well 
it conforms to what i'm use to in java and ColdFusion,
views are almost the same as CF MVC. at some point i will do a write 
up on my blog http://www.glynjackson.org/blog/ (plug, plug)


so i have some of the basic stuff down with models and views, I'm sure 
i will have lost of stupid questions in the coming months.


I go to some cons so why not add another one to my list (my wife will 
kill me)!!!



again thanks :)





I'm pretty glad, that you found django helpful for you.

There is no stupid questions. There are only stupid answers





On Tuesday, December 18, 2012 9:36:42 PM UTC, Glyn Jackson wrote:

I'm hoping this is the right place to ask such questions, please
forgive me if not.

I'm making a real time investment in learning another server side
language. I have 10 years ColdFusion, 5 years  PHP, JAVA. Having
never touched Python let alone the framework Django, for the past
4 weeks I have been testing Django out. Darn, Raspberry Pi started
me with my blog (http://www.glynjackson.org/blog/
) I have to say its nice,
however my concerns are now to do with the community and not so
much with the framework itself.

No one likes to back a loser and every time I search for Django
community I'm faced with a host of negative posts. for example:
http://news.ycombinator.com/item?id=2777883


Unlike other languages I'm active in and still use, I'm also
finding it hard to find any user groups locally in the UK (I'm
based in Manchester, UK).

So from the community itself how alive is Django? Should I really
invest the time to learn? Does it have a real future and please be
honest.

other questions

1) is this worth going? --- http://2013.djangocon.eu
2) who are the top blogs people within the Django community who
should I be following, blogs feed etc.

Sorry for the stupid questions, but and just want a new skillset
that I can use for many years to come. Django is really cool









--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IEh4i5vg2qAJ.

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.


--
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: new user

2012-12-21 Thread peter

On 12/21/2012 02:13 PM, Satinderpal Singh wrote:

On Fri, Dec 21, 2012 at 5:57 PM, senthil mariyappan
 wrote:

hi friends, i new one to django..

  Welcome, man. I hope we can help you!!.

Welcome to the Django family.

--
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/



--
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.



Easiest Way to Deploy Django?

2013-02-21 Thread Peter
I've a new Django user who went through the tutorial and built a few very 
simple apps (e.g. a Craigslist app) using SqlLite for my database.

Can someone advise on what's the best way to deploy a simple Django app? 
 I'm aware of Heroku's Django tutorial but am not yet familiar with how to 
use Postgres.  Should I learn how to work with a real database first?

Thanks!
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Easiest Way to Deploy Django?

2013-02-23 Thread Peter
Thanks Russell for your answer.  I've been playing with Postgres and it's 
not nearly as complicated as I thought.  I'll have to figure out how to 
deploy postgres in production, wish me luck.

Best,
Peter

On Thursday, February 21, 2013 4:25:00 PM UTC-8, Russell Keith-Magee wrote:
>
>
> On Fri, Feb 22, 2013 at 5:58 AM, Peter  >wrote:
>
>> I've a new Django user who went through the tutorial and built a few very 
>> simple apps (e.g. a Craigslist app) using SqlLite for my database.
>>
>> Can someone advise on what's the best way to deploy a simple Django app? 
>>  I'm aware of Heroku's Django tutorial but am not yet familiar with how to 
>> use Postgres.  Should I learn how to work with a real database first?
>>
>
> Long term, learning how to use PostgreSQL in depth will certainly be worth 
> your time. However, if you're just starting out with database-backed web 
> development, there's isn't much you need to know. One of the benefits of 
> using a tool like Django's ORM is that you don't need to know about the 
> details of your data store. Your SQLite code should work exactly the same 
> on PostgreSQL. User.objects.all() works the same regardless of the database 
> you're using.
>
> At some point you'll definitely need to learn more about PostgreSQL -- 
> especially if you start looking at going into production and you need to do 
> some performance tuning. However, if you just want to get your site up and 
> running on Heroku, I'd suggest just following the Heroku tutorials and 
> taking the PostgreSQL-specific bits as boiler plate.
>
> Yours,
> Russ Magee %-)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Reverse Lookup Failure on password change/reset views

2013-07-23 Thread Peter
I'm probably doing something stupid here but I can't see it.  I'm trying to 
implement password change and reset using auth, and I'm getting a "No 
Reverse Match" error for the password_reset_done view.  Normally that would 
mean that I forgot to creaste a url that calls this view, but I have, and 
other views in that block (like login) work fine.

So, in my main urls.py I have:


# Registration URLs
urlpatterns += patterns('',
url(r'^registration/', include('registration.urls', 
namespace='registration')),
)

and there is no occurrence of 'registration' above this code in the urls.py.

Then, in the registration.urls.py:

from django.conf.urls import patterns, include, url
import django.contrib.auth.views
import registration.views

urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login', {}, 'login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {}, 'logout'),
url(r'^password_change/$', 'django.contrib.auth.views.password_change',
{}, name='password_change'),
url(r'^password_change_done/$', 
'django.contrib.auth.views.password_change_done',
{}, name='password_change_done'),

url(r'^password_reset/$', 'django.contrib.auth.views.password_reset',
{}, 'password_reset'),
url(r'^password_reset_done/$', 
'django.contrib.auth.views.password_reset_done',
{}, 'password_reset_done'),
url(r'^password_reset_confirm/(?P.+)/(?P.+)/$', 
'django.contrib.auth.views.password_reset_confirm',
{}, 'password_reset_confirm'),
url(r'^password_reset_complete/$', 
'django.contrib.auth.views.password_reset_complete',
{}, 'password_reset_complete'),

url(r'^profile/$', registration.views.profile, {}, 'profile'),
url(r'^profile/edit/$', registration.views.profile_edit, {}, 
'profile_edit'),
...

and you can see that a url that invoked password_reset_done actually exists.

But on going to the password reset page: 
http://127.0.0.1:8000/registration/password_reset/  I get:

NoReverseMatch at /registration/password_reset/ 

Reverse for 'django.contrib.auth.views.password_reset_done' with arguments '()' 
and keyword arguments '{}' not found.

 Request Method: GET  Request URL: 
http://127.0.0.1:8000/registration/password_reset/  Django Version: 1.5.1  
Exception 
Type: NoReverseMatch  Exception Value: 

Reverse for 'django.contrib.auth.views.password_reset_done' with arguments '()' 
and keyword arguments '{}' not found.

 Exception Location: 
/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py 
in _reverse_with_prefix, line 416  Python Executable: /usr/bin/python  Python 
Version: 2.7.3  Python Path: 

['/home/peter/django-sites/simbiant/sched/django-src',
 '/usr/local/lib/python2.7/dist-packages/pytz-2013b-py2.7.egg',
 '/home/peter/django-sites',
 '/home/peter/django-sites/simbiant/sched/django-src',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

 Server time: Wed, 24 Jul 2013 15:21:45 +0930
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/registration/password_reset/

Django Version: 1.5.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.flatpages',
 'debug_toolbar',
 'scheduler',
 'registration')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.Se

Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
> used the url tag in the template wrong - it changed between two django 
versions

Thanks Christian, but I'm pretty sure the reverse is being invoked from the 
Django auth code (django.contrib.auth.password_reset) , not my template; 
nevertheless the template I'm using (registration/password_reset_form.html) 
is:

{% extends "registration/base_registration.html" %}
{% load i18n %}

{% block title %}{{ block.super }} - {% trans 'Password reset' %}{% 
endblock %}

{% block pageheading %}{{ block.super }}Password reset{% endblock %}

{% block content %}
{% trans "Forgotten your password? Enter your e-mail address below, and 
we'll e-mail instructions for setting a new one." %}


{{ form.email.errors }}
{% trans 'E-mail address:' %} {{ 
form.email }} 


{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
On Wednesday, July 24, 2013 4:46:07 PM UTC+9:30, Peter wrote:
>
> > django.contrib.auth.password_reset
>

Sorry, that should be: django.contrib.auth.views.password_reset 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reverse Lookup Failure on password change/reset views

2013-07-24 Thread Peter
> Sorry, that should be: django.contrib.auth.views.password_reset 

In fact, I'm pretty sure it's this line of code in auth::

File "/usr/local/lib/python2.7/
dist-packages/django/contrib/auth/views.py" in password_reset
  147. post_reset_redirect = 
reverse('django.contrib.auth.views.password_reset_done')

The question is: if I actually have a url dispatcher entry that references 
this view function, then why can't 'reverse' find it?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reverse Lookup Failure on password change/reset views

2013-07-27 Thread Peter
Yep, that fixed it.  Thanks.

I still think it's wrong of django not to find it by view name though...


> Probably because you've included it under a namespace, so Django would 
> need to look for it as "registration:whatever". There's no need to use the 
> namespace in the include call.
> --
> DR. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Help with a somewhat complex reverse ForeignKey lookup.

2011-01-12 Thread Peter
If I have a couple of models like these (just an example)

class Parent(models.Model):
name = models.CharField(max_length=100)

class Gender(models.Model):
name = models.CharField(max_length=100)

class Child(models.Model):
entity = models.ForeignKey(Entity, related_name=’children’)
gender = models.ForeignKey(Gender)
name = models.CharField(max_length=100)


How can i get a list of parents that _doesn't_ have a child of a
certain gender?

>>> gender = Gender.objects.get(name='female')
>>> Parent.objects.filter(#whatever that gets parents that doesn't have a child 
>>> with gender=gender#)

I'm completely lost here so please help me out.
If it was about getting parents with no children then
"children__isnull=True" should do it but now I don't know.
The answer is probably obvious but I'm suffering from a mental block
right here.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatten template?

2011-01-12 Thread Peter
Please add to djangosnippets I'm somewhat interested in what you have 
done.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help with a somewhat complex reverse ForeignKey lookup.

2011-01-12 Thread Peter
And your example of course worked It's obvious really and just stupid of 
me.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Non-Ascii Characters in URL causes crash

2013-11-20 Thread Peter
I have a slightly weird issue.  Someone is sending http requests with 
Chinese characters in the URL.  Ok, it's probably just Chinese hackers 
trying something.  But it's causing Django to fall over with a 
UnicodeEncodeError in the response.

I'm thinking this must be a bug in Django as the response is generated by 
Django itself.

I have flatpages turned on, and obviously this url doesn't match anything I 
have in flatpages so it's somewhere in the flatpage not found path.  I also 
have I18N turned on.

I'm running Django version 1.4.8.  Below is the traceback.

Should I just ignore this?

Peter

Traceback (most recent call last):

  File "/home/peter/django-ductedit/django/core/handlers/base.py", line 92, in 
get_response
response = callback(request, *callback_args, **callback_kwargs)

  File "/home/peter/django-ductedit/django/contrib/flatpages/views.py", line 
23, in flatpage
return HttpResponseRedirect("%s/" % request.path)

  File "*/home/peter/django-ductedit/django/http/*__init__.py", line 407, in 
__init__
self['Location'] = redirect_to

  File "*/home/peter/django-ductedit/django/http/*__init__.py", line 320, in 
__setitem__
header, value = self._convert_to_ascii(header, value)

  File "*/home/peter/django-ductedit/django/http/*__init__.py", line 309, in 
_convert_to_ascii
value = value.encode('us-ascii')

UnicodeEncodeError: 'ascii' codec can't encode characters in position 10-13: 
ordinal not in range(128), HTTP response headers must be in US-ASCII format


,
POST:,
COOKIES:{},
META:{'DOCUMENT_ROOT': '*/home/peter/public_html/*',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_HOST': 'www.plandroid.com',
 'HTTP_REFERER': 'http://www.baidu.com',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) 
Gecko/20100101 Firefox/18.0',
 'HTTP_X_FORWARDED_FOR': '183.60.243.188',
 'HTTP_X_FORWARDED_PROTO': 'http',
 'HTTP_X_HOST': 'www.plandroid.com',
 'PATH_INFO': u'*/template/*\u8bf7\u52ff\u5220\u96646kbbs\u6a21\u677f.txt',
 'PATH_TRANSLATED': 
'*/home/peter/public_html//template/*\xe8\xaf\xb7\xe5\x8b\xbf\xe5\x88\xa0\xe9\x99\xa46kbbs\xe6\xa8\xa1\xe6\x9d\xbf.txt',
 'QUERY_STRING': '',
 'REDIRECT_STATUS': '200',
 'REDIRECT_URI': 
'*/django.fcgi/template/*\xe8\xaf\xb7\xe5\x8b\xbf\xe5\x88\xa0\xe9\x99\xa46kbbs\xe6\xa8\xa1\xe6\x9d\xbf.txt',
 'REMOTE_ADDR': '183.60.243.188',
 'REMOTE_PORT': '15624',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': 
'*/template/*\xe8\xaf\xb7\xe5\x8b\xbf\xe5\x88\xa0\xe9\x99\xa46kbbs\xe6\xa8\xa1\xe6\x9d\xbf.txt',
 'SCRIPT_FILENAME': '/home/peter/public_html/django.fcgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '127.0.0.1',
 'SERVER_NAME': 'www.plandroid.com',
 'SERVER_PORT': '62305',
 'SERVER_PROTOCOL': 'HTTP/1.0',
 'SERVER_SOFTWARE': 'lighttpd',
 'wsgi.errors': ,
 'wsgi.input': ,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7428b624-197e-4e03-b78f-f952ae99bd8a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Split a form up in the template/view?

2008-10-22 Thread Peter Bengtsson



On Oct 22, 5:10 pm, Ardesco <[EMAIL PROTECTED]> wrote:
> Taking an example from Chapter 7 of the Django Book:
>
> from forms import PublisherForm
>
> def add_publisher(request):
>     if request.method == 'POST':
>         form = PublisherForm(request.POST)
>         if form.is_valid():
>             form.save()
>             return HttpResponseRedirect('/add_publisher/thanks/')
>     else:
>         form = PublisherForm()
>     return render_to_response('books/add_publisher.html', {'form':
> form})
>
> If say my model had 10 attributes, and I wanted to split it up into 5
> different blocks (i.e. put pairs of elements in their own div block
> and whatnot), is there any easy way to do this? I know if you pass
> lists in, you can do something along the lines of:
> {% for item in form|slice:":2" %} to get the first two elements, for
> example, but you apparently cannot do this when you pass a form object
> to the template. Is there an easy way to do this without writing a lot
> of code in the template/view?

Easy. Turn the fields in the a list and then slice works. But you have
to do that in the view as far as a I know.
So

fields = list(my_form)
return render_to_response(...

Then:

  {% for field in fields|slice:":5" %}
{{ field }}
  {% endfor %}


--~--~-~--~~~---~--~~
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: www.djangosnippets.org is down now?

2008-10-22 Thread Peter Bengtsson

When I get an error on viewing a snippet I copy the URL into Google
and click the Cached version.

On Oct 22, 5:08 pm, Gmail <[EMAIL PROTECTED]> wrote:
> i found lots of snippets to download,but the server always says it is  
> down.
--~--~-~--~~~---~--~~
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: Django Suitability

2008-10-22 Thread Peter Bengtsson



On Oct 22, 3:56 pm, "Matthew Talbert" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am being considered for a project that would involve re-writing an
> application which is currently in MS Access/VBA. The application is an order
> entry/shop management software for a small vertical market. I am strongly in
> favor of using Django for the project and one of the principles is mostly
> convinced that will be fine. The other wants a third-party (who currently
> develop applications with Servoy) to check into Django/Python and evaluate
> it for its suitability for this project. The requirements for the project
> are these:
>
> 1. Rapid development
> 2. Stability
> 3. Ease of use
> 4. Customer access including order entry (currently orders can only be
> entered by staff)
> 5. Remote access via smart phone
>
Those requirements would fit any decent web framework except the Java
ones :)

> My questions are these:
>
> 1. Is there anyone out there who has used Django and Servoy?
> 2. Has anyone done an order entry system (not pinax) or accounting system (I
> know of the projects on google code) or interfaced with legacy systems with
> Django?
Building one at the moment. Nothing to share though since there's
nothing specific about it. It just a web app.

> 3. There seems to be a concern that Django isn't used by "big names". Are
> there big names using Django (other than the newspapers and google)? I have
> looked through django sites quite a bit and found a few universities but not
> a lot else.

Google banked on Django when they built the Google App Engine.

> 4. I welcome any other comments, thoughts, opinions, or references as to the
> suitability of Django for this project.
>
Key is PYTHON. Django is very modular and loosely couple and you get
immediate access to the world of Python in your models and views and
then only the sky is the limit.
If there's a Python module for ODBC, Access, etc. then YES it can be
used in Django.


> I apologize if any/all of this is redundant. I am a big fan of Django, so
> thanks to all the developers and community!
>
> Matthew
--~--~-~--~~~---~--~~
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: ViewDoesNotExist: Even though it does

2008-10-22 Thread Peter Bengtsson

Have you written a unit test that executes the view? If so, and if it
doesn't always happen, you can run the unit test over and over quickly
to see if it has something strange to do with the order of how things
are important or something crazy like that.
By the way, writing tests can often help fish problems and errors that
are otherwise "hidden" by the magic of wiring when you run Django.
Has definitely helped me in the past.

On Oct 22, 8:09 am, JonathanB <[EMAIL PROTECTED]> wrote:
> Getting a very erratic Exception:
>
> ViewDoesNotExist: Could not import supplier.views. Error was: cannot
> import name Buyer
>
> What is stage is Buyer (model Class) does exist and the exception is
> only thrown once in a while. Could it be that there are too many
> ForeignKey relationships. i.e. the Buyer model is used in 3 other
> models.
--~--~-~--~~~---~--~~
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: second post:Please answer!How to compare from two models in the same function (view)?

2008-10-22 Thread Peter Bengtsson



On Oct 22, 1:23 pm, Net_Boy <[EMAIL PROTECTED]> wrote:
> Hi,
>    I am trying to make a view function to get the posted values and
> make some comparison (if x.value >= y.value)..
> where x is the model that I got it's values from the post
> and   y is the other model .
>
> example:
>
> def comp(request):
>     form = ItemForm()
>     if request.method=="POST":
>       form = ItemForm(request.POST, request.FILES)
>       if form.is_valid():
>           if item.price >= old.price and item.pub_date <=
> old.pub_date
>             item = form.save(commit=False)
>             item.seller = request.user
>             item.save()
>             form = ItemForm()
>       else:
>                 pass
>     return render_to_response(
>           "add_item.html",
>           {"form": form},context_instance=RequestContext(request))

But that is not comparing two models. One of them is a form instance
the other ("old") is something else.
If you want to compare two models you have to add a __eq__ method to
your view class.
I guess the same applies if you want to compare two form instances.

--~--~-~--~~~---~--~~
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: Accessor for field 'user' clashes with related field 'User.*'

2008-10-22 Thread Peter Bengtsson

I don't see what splitting it up into "sub apps" has anything to do
with it?
What happens when you add the related_name attribute to your model
fields?
Here's some code from one of my apps:

class M(models.Model):
...
from_user = models.ForeignKey(User, null=True,
related_name='from')
to_user = models.ForeignKey(User, null=True, related_name='to')


On Oct 22, 11:09 am, lcordier <[EMAIL PROTECTED]> wrote:
> I have recently changed the layout of my code. Putting all my apps
> into an apps sub-directory to make things a bit cleaner. Basically the
> same layout 
> ashttp://code.djangoproject.com/browser/djangoproject.com/django_websit...
>
> To run my tests I have to go into the apps sub-directory and run it
> like so:
> ../manage.py test app
>
> The problem, now all foreign key's result in:
> apps/profiles.userprofile: Accessor for field 'user' clashes with
> related field 'User.lala_set'. Add a related_name argument to the
> definition for 'user'.
> apps/profiles.userprofile: Reverse query name for field 'user' clashes
> with related field 'User.lala_set'. Add a related_name argument to the
> definition for 'user'.
>
> No matter what 'related_name' I choose, I mean no clashes with other
> tables.
> My questions:
>
> 1. How does test work for django_website?
> 2. Anyone else with a non-standard apps layout, with a solution to
> this problem?
>
> Regards, Louis.
--~--~-~--~~~---~--~~
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: Forms generated from models missing primary key

2008-10-22 Thread Peter Bengtsson



On Oct 22, 8:24 am, MrMuffin <[EMAIL PROTECTED]> wrote:
> I'm generating html forms from models using ModelForm. When I do
> something like :
>
> >>> article = Article.objects.get(pk=1)
> >>> form = ArticleForm(instance=article)
>
Change it's widget to hidden I think should work

>>> from django.forms.widgets import HiddenInput
>>> form.fields['id'].widget = HiddenInput()


> the generated form doesn`t have a hidden field for the primary key.
> Why? What`s the best way to add 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Test client: how to tell if user is logged in?

2008-10-22 Thread Peter Bengtsson

It's definitely possible. Here's an example:

from django.contrib.auth.models import User
staff = User.objects.create_user(username='s', password='s',
email='[EMAIL PROTECTED]')
#staff.is_staff = True

client = Client()
assert client.login(username='s', password='s')
client.get('/view/that/uses/request.user/')


On Aug 26, 7:41 pm, Aaron Maxwell <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Using django 1.0beta'stestclient, is there some reliable way to tell if 
> atestuseris logged in?
>
> It would be nice to do this within thetestcase code.  However, even within a
> view, using request.user.is_authenticated does not seem to work properly.
>
> Thanks,
> Aaron
>
> --
> Aaron Maxwellhttp://redsymbol.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
-~--~~~~--~~--~--~---



Re: www.djangosnippets.org is down now?

2008-10-22 Thread Peter Bengtsson

Not down but you get lots of errors. They're probably working on it. I
hope.

On Oct 22, 5:08 pm, Gmail <[EMAIL PROTECTED]> wrote:
> i found lots of snippets to download,but the server always says it is  
> down.
--~--~-~--~~~---~--~~
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: What do you use for design interface / mockup

2008-10-23 Thread Peter Herndon

At the risk of being flamed, I'd say that nothing is better than OmniGraffle.

That aside, both Gimp and Dia are cross-platform and very reasonable
choices.  They may not fit the Mac gui, but they work well enough if
cross-platform is a higher priority than best-of-breed.  You can get
the job done with them.

If cross-platform is not your highest priority, I'd pick OmniGraffle
and Acorn, with Photoshop and such as the big guns, as required.
Though, there's a lot to be said for wireframing in HTML, and for
paper prototypes.

---Peter

On 10/23/08, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> Francis,
>
> I'm not a designer but I start my global layout on paper or in my head and
> then it's (x)html and CSS. The first thing that comes to mind on doing this
> electronically is photoshop (and siblings ... CS3?). And the Gimp but that
> would not be a good choice on OSX (gui handling wise).
>
> Regards,
>
> Gerard.
>
> Francis wrote:
>> Hi,
>>
>> What do you use for design interface / mockup?
>>
>> I made some search, omnigraph seems pretty popular. But I often switch
>> between linux and Mac and omnigraffle isn't cross platform.
>>
>> Is there any tools out there that work on Mac OS X and Linux? (or
>> something better than omnigraffle)
>>
>> Thank you
>>
>>
>>
>> >
>
> --
> urls = { 'fun':  'www.zonderbroodje.nl',  'tech':  'www.gp-net.nl' }
>
>
> >
>

--~--~-~--~~~---~--~~
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: Noon Help

2008-10-27 Thread Peter Herndon

I might also suggest django-registration
(http://code.google.com/p/django-registration) to handle your user
registration needs.

On Mon, Oct 27, 2008 at 2:34 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> Johnny Utah wrote:
>> Thanks for the input.
>>
>> When you say Django.admin would be useful, do you mean users would
>> access the admin interface?
>>
> Please respond to the list when asking further questions.
>
> That being said: no-- users shouldn't access the admin interface. Admins
> should. It's there to make your life much easier, and it does that very
> well. You'll still need to build views for your app, but if you need to
> go in and change something manually, the admin interface is way better
> than dropping to SQL.
>
> Jeff Anderson
>
>

--~--~-~--~~~---~--~~
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 chain filters with multi-value realtions?

2008-10-29 Thread Peter Krantz

Hi!

I am new to Django and just discovered an issue when trying to filter
querysets with multi-value relations.

Let's say I have a Article and Tag model where an Article can have
many Tags. I have a use case where a bunch of get parameters filters
the list of articles based on Article model fields similar to this:

articles = Article.objects.all()
article_length = request.GET.get('article_length', '')
if some_condition:
  articles.filter(article_length__gte = article_length)

This type of conditional filter chaining works well. However, it isn't
possible to add a filter to limit the query set based on multi value
relations like this:

# code above plus:

if some_other_condition:
  #apply second filter
  articles.filter(tag__id__in = [1,2,3])

The docs [1] say:

"Successive filter() calls further restrict the set of objects, but
for multi-valued relations, they apply to any object linked to the
primary model, not necessarily those objects that were selected by an
earlier filter() call."

What is the correct way to conditionally filter on multivalue
relations? Do force the loading of the previous filtering and then
manually loop over the collection to remove items?

Regards,

Peter

[1]: 
http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Multiple saves without redirecting

2008-11-05 Thread Peter Bailey

I want to create a form for a large object that has numerous non-
mandatory fields. I am still learning django, and am missing something
easy I hope. All the examples and docs I see say to redirect after the
form is posted and saved to the db (in my case). What I want is to
leave the form up after the initial post, and allow a user to say, add
3 more field entries and re-save, etc. This is to handle a use case of
when they are working on some data entry, want to save a partially
done page, and then either leave it up and continue at their leisure
or also come back and choose the object again and fill some more of
the info in (I guess those are really 2 use cases!).

This is a fairly common way of doing things in many of the business
sites I have worked on, but I cannot find much discussion on it or
documentation regarding it. Can anyone point me at some examples of
this type of usage or suggest an alternative. I am starting to wonder
if I am trying to bend the framework the wrong way, and maybe I need
to rethink my design.

Thanks for any feedback or help. It will be greatly appreciated. This
is an amazing framework but it is taking me a while to learn some of
the ins and outs. Must be from all those years of MS web programming
that have clouded my brain!

Cheers,

Peter
--~--~-~--~~~---~--~~
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: Multiple saves without redirecting

2008-11-05 Thread Peter Bailey

Well that sounds very logical. Thanks very much. I'll make the changes
and give it a go.

Thanks again,

Peter


On Nov 5, 11:51 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Nov 5, 3:54 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
>
>
>
> > I want to create a form for a large object that has numerous non-
> > mandatory fields. I am still learning django, and am missing something
> > easy I hope. All the examples and docs I see say to redirect after the
> > form is posted and saved to the db (in my case). What I want is to
> > leave the form up after the initial post, and allow a user to say, add
> > 3 more field entries and re-save, etc. This is to handle a use case of
> > when they are working on some data entry, want to save a partially
> > done page, and then either leave it up and continue at their leisure
> > or also come back and choose the object again and fill some more of
> > the info in (I guess those are really 2 use cases!).
>
> > This is a fairly common way of doing things in many of the business
> > sites I have worked on, but I cannot find much discussion on it or
> > documentation regarding it. Can anyone point me at some examples of
> > this type of usage or suggest an alternative. I am starting to wonder
> > if I am trying to bend the framework the wrong way, and maybe I need
> > to rethink my design.
>
> > Thanks for any feedback or help. It will be greatly appreciated. This
> > is an amazing framework but it is taking me a while to learn some of
> > the ins and outs. Must be from all those years of MS web programming
> > that have clouded my brain!
>
> > Cheers,
>
> > Peter
>
> There's nothing to say you shouldn't redirect back to the same page,
> or a version of it. The point of the redirect is simply to remove the
> possibility that the user would re-post the data if they pressed Back.
>
> Presumably, you have an 'add' page where the users create the original
> data. Once that is submitted, you'll need a page they can go to edit
> existing data. So, to use the same model as the built-in admin site,
> you'd have /mymodel/add/ and /mymodel/x/, where x is the PK of the
> existing instance. So all you want to do is, on save redirect to the
> 'edit' screen. In your view:
> if form.is_valid():
>     obj = form.save()
>     return HttpResponseRedirect('/mymodel/%s/' % obj.pk) # or better,
> use a URL reverse function
>
> You might want to do some checking of the POST first to see if they've
> chosen a button that allows them to continue editing, rather than
> quit.
>
> Now I've written this, I've realised this is *exactly* what the admin
> site does with the 'Save and continue editing' button - you might want
> to look in django.contrib.admin.views for some clues as to how this
> works.
>
> --
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Newbie question: HTML formatting not applied to pages

2008-11-06 Thread Peter Rowell

You're being tripped up by auto-escaping of variable contents. This is
a security feature that was first introduced in November of last year.
(http://code.djangoproject.com/changeset/6671)

See http://docs.djangoproject.com/en/dev/ref/templates/builtins/#autoescape
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Turning key=value1&key=value2&key=value3 into a list

2008-11-12 Thread Peter Bengtsson

If I publish
http://someurl/myview?foo=1&foo=2&foo=3

How do I turn this into foo = ['1','2','3']?
--~--~-~--~~~---~--~~
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: ImageField upload_to not workin

2008-11-14 Thread Peter Bengtsson



On Nov 14, 9:31 pm, Javier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've create a model:
>
> class ImagenesLugar(models.Model):
>     archivo = models.ImageField(upload_to="imageneslugar/")
>     texto = models.CharField(max_length=400)
>
> The thing is that when i create a new instance of this model and
> assign instance.archivo to a file then instance.archivo.path does not
> contain my upload_to parameter:
>
> Ie:
>
> my media root is :"/home/media"
> my uploadto is "imageneslugar"
> my file is "image.jpg"
>
> I do:
> instance.archivo = "image.jpg"

Is this pseudo code or does that actually work? I do this:
instance.achivo.save('image.jpg', request.FILES['photo'])

>
> then:
> instance.archivo.path is:
> /home/media/image.jpg
> instead of
> /home/media/imageneslugar/image.jpg
>
> what am I missing?
--~--~-~--~~~---~--~~
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: psycopg2 Visual Studio installation error on XP

2008-11-17 Thread Peter Herndon

Hi DJ,

Psycopg2 has a C extension wrapped by Python.  That C extension must
be compiled with the same compiler used to compile the Python compiler
itself.

This is not a Django issue, this is a psycopg issue.  You should ask
for assistance on the psycopg mailing list, they'll be better able to
help you.

You should also look around for pre-compiled binaries of psycopg2 for
Windows, as the packagers will have taken this compiler mismatch issue
into account.

---Peter

On 11/17/08, dj <[EMAIL PROTECTED]> wrote:
>
> Hello All,
>
> I am django novice and i am very, very ,very, very green.
>
> I am trying to setup the PostgresSQL database with the psycopg2
> library. I downloaded the psycopg2-2.0.8.tar file.
> Opened the tar with Winzip and installed the library from the command
> line using python setup.py. I got this really strange error message.
>
> error: Python built with Visual Studio 2003; extensions must be built
> with a complier than can generate compatiable binaries. Visual Studio
> 2003 was not found on this system. If you have Cygwin installed, you
> can tru compiling with MingW32, by passing "-c mingw32 to setup.py"
>
> I am not using Visual Studio for any of my development, I am using the
> python.
> Do I need to install Cywgin or is there a work around ?
> >
>

--~--~-~--~~~---~--~~
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: Setting Up Django on Vista and Creating a Database

2008-11-17 Thread Peter Herndon

The other thing that comes to mind is, have you installed the MySQLdb
python library?  If you want to connect to a database from a Python
app, you must also install a library that bridges Python and the
database.

(I apologize in advance if you've already done so).

---Peter

On 11/17/08, Karen Tracey <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 17, 2008 at 3:13 AM, John Antony <[EMAIL PROTECTED]> wrote:
>
>>
>> I have currently created a database with the following details:
>> DATABASE_ENGINE = 'mysql'
>> DATABASE_NAME = 'myforum'
>> DATABASE_USER = 'root'
>> DATABASE_PASSWORD = 'myforum'
>> DATABASE_HOST = 'localhost'
>> DATABASE_PORT = ''
>>
>
> Is this a cut and paste from your actual setting files?  Because that
> setting for DATABASE_ENGINE -- all lowercase mysql -- is correct.
>
>
>> I used phpMyadmin to create the database
>>
>> I have updated C:\projects\myforum\settings.py in the similar
>> fashion
>>
>> However when i run the the following command i get:
>>
>> C:\projects\myforum>python manage.py runserver
>> Validating models...
>> Unhandled exception in thread started by > 0x027CC670>
>> Traceback (most recent call last):
>>  File "C:\Python26\Lib\site-packages\django\core\management\commands
>> \runserver.
>> py", line 48, in inner_run
>>self.validate(display_num_errors=True)
>>  File "C:\Python26\Lib\site-packages\django\core\management\base.py",
>> line 122,
>>  in validate
>>num_errors = get_validation_errors(s, app)
>>  File "C:\Python26\Lib\site-packages\django\core\management
>> \validation.py", lin
>> e 22, in get_validation_errors
>>from django.db import models, connection
>>  File "C:\Python26\Lib\site-packages\django\db\__init__.py", line 34,
>> in > e>
>>(settings.DATABASE_ENGINE, ", ".join(map(repr,
>> available_backends)), e_user)
>>
>> django.core.exceptions.ImproperlyConfigured: 'MySQL' isn't an
>> available database
>>  backend. Available options are: 'dummy', 'mysql', 'oracle',
>> 'postgresql', 'post
>> gresql_psycopg2', 'sqlite3'
>> Error was: No module named MySQL.base
>>
>
> Whereas what this is saying is that you have 'MySQL' set as your
> DATABASE_ENGINE, and that is not correct.  Case matters.  What you have in
> your settings file needs to be all lower case for the DATABASE_ENGINE
> setting.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Keeping fields out of the Admin

2008-11-22 Thread Peter Rowell

On Nov 21, 10:58 am, maeck <[EMAIL PROTECTED]> wrote:
> Please note that the result of this is that if you use
> 'editable=False' this field is not visible in the admin at all.
> As far as I know there is no good way (see below) of putting read only
> data in an admin page.

The world is strange. Literally moments before I read this post I was
reading an ongoing discussion about exactly this issue. Why was this
strange? Because I was looking at one of the oldest still-open Django
tickets. (Albeit, one that has been opened/closed/opened/closed/etc.
several times.)

08/19/05 15:52:39 changed by adrian
http://code.djangoproject.com/ticket/342

Summary: A lot of people need the option to display readonly field
information in the admin interface, and have been talking about it for
over 3 years.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



locmem or memcache

2008-11-28 Thread Peter Bengtsson

What's faster, locmem or memcache?

I know that the docs rave on about how fast memcache is but what about
locmem? That sounds pretty fast to me since it doesn't need another
TCP service and just uses the RAM.
My particular site (for mobile phones without any media) is so tiny
that I wouldn't worry about some RAM bloat.
--~--~-~--~~~---~--~~
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: Ordering bookeditions by their rating

2008-11-28 Thread Peter Bengtsson

The trick is to use .query.group_by.
Here's an example that will work::

>>> from collection.models import Edition, User, Rating
>>> Rating.objects.all().delete()
>>> Edition.objects.all().delete()
>>>
>>> e1 = Edition.objects.create(title=u'Title1', binding=u'')
>>> e2 = Edition.objects.create(title=u'Title2', binding=u'')
>>> e3 = Edition.objects.create(title=u'Title3', binding=u'')
>>> me = User.objects.all()[0]
>>> __ = Rating.objects.create(user=me, edition=e1, rating=3)
>>> __ = Rating.objects.create(user=me, edition=e1, rating=4)
>>> __ = Rating.objects.create(user=me, edition=e1, rating=2)
>>> __ = Rating.objects.create(user=me, edition=e2, rating=5)
>>> __ = Rating.objects.create(user=me, edition=e2, rating=6)
>>> __ = Rating.objects.create(user=me, edition=e2, rating=5)
>>> __ = Rating.objects.create(user=me, edition=e3, rating=1)
>>> __ = Rating.objects.create(user=me, edition=e3, rating=2)
>>> __ = Rating.objects.create(user=me, edition=e3, rating=1)
>>> __ = Rating.objects.create(user=me, edition=e3, rating=3)
>>>

So at this point Edition 1 has 3 ratings of 3,4 and 2 (average = 3)
Edition 2 ratings 5, 6 and 5 (average = 5.33)
Edition 3 ratings 1, 2, 1, 3 (average = 1.75)

So the highest average is Edition 2.
Now we'll do the complex select.

>>> qs = Rating.objects.all().order_by('-avg')
>>> qs = qs.extra(select={'s':'sum(rating)',
...   'c':'count(rating)',
...   'avg':'sum(rating)::float/count(rating)'})
>>> qs = qs.values('edition_id','s','c','avg')
>>> qs.query.group_by = ['edition_id']
>>> print qs.query.as_sql()
(u'SELECT (sum(rating)) AS "s", (sum(rating)::float/count(rating)) AS
"avg", (count(rating)) AS "c", "collection_rating"."edition_id" FROM
"collection_rating" GROUP BY edition_id ORDER BY "avg" DESC', ())
>>> for e in qs:
... print e
...
{'s': 16L, 'avg': 5.3304, 'edition_id': 2, 'c': 3L}
{'s': 9L, 'avg': 3.0, 'edition_id': 1, 'c': 3L}
{'s': 7L, 'avg': 1.75, 'edition_id': 3, 'c': 4L}
>>> edition_ids = [x['edition_id'] for x in qs]
>>> edition_ids
[2, 1, 3]



That should get you going. Now you have to do something with this
ordered list of edition_ids.
You can use this for a filter on a more elaborate QuerySet. Something
like this:
cool_editions = Editions.objects.filter(id__in=edition_ids).exclude
(title__icontains='Fudge').order_by('-binding')


I hope that helps!


On Nov 28, 10:07 am, coan <[EMAIL PROTECTED]> wrote:
> I have book editions in my database. Users can rate editions. If they
> want, they can also add them to their book collection.
> Here is a simplified overview of the models:
>
> class Edition(models.Model):
>  title   = models.models.CharField(max_length=255)
>  binding        = models.models.CharField(max_length=30)
>
> class Bookcollection(models.Model):
>  user    = models.ForeignKey(User)
>  edition = models.ForeignKey(Edition)
>
> class Rating(models.Model):
>  user    = models.ForeignKey(User)
>  edition = models.ForeignKey(Edition)
>  rating = models.PositiveIntegerField()
>
> I can fetch all the books in a users bookcollection with editions =
> user.edition_set.all()
> What do I do if I want to order a users bookcollection by the rating
> he or she gave 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ForeignKey value return from web page

2008-12-03 Thread Peter Bailey

I am trying to use ForeignKey data returned from a page and view, and
am having trouble. I am missing something fundamental I think.

Say I have 2 models

class TopModel(models.Model):
name = models.CharField(max_length=50)
db_type = models.CharField(max_length=1, choices=STATUS_DBS)

# and another class with an FK to the above

class OtherModel(models.Model):
name = models.CharField(max_length=50)
topmodel = models.ForeignKey(TopModel)


# Form classes for the above are just as follows:

class TopModelForm(forms.ModelForm):

class Meta:
model = TopModel

class OtherModel(forms.ModelForm):

class Meta:
model = OtherModel


Anyway, if I go to a page template and view for OtherModel, say the
user selects an fk for TopModel in OtherModel,
I want to get back the actual fk number , e.g, 3, 10, 1, or whatever
from the post dict. I currently do not get a value back for this (or
I am calling it the wrong thing or something).

I just want the Interger id for the fk that would be in the db). I
want to use this type of access several layers deep in cases,
and this seems like it should be dirt simple (it would be the old
school way), but of course, I am trying to get away from that.

I have been looking through the docs and things and just confusing
myself
more and more.

So, can anyone tell me what I am doing wrong or if there is an easy
(and efficient) way to do this, or perhaps point me to a piece of
actual code that does something similar.

Thanks very much,

Peter
--~--~-~--~~~---~--~~
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: ForeignKey value return from web page

2008-12-03 Thread Peter Bailey

Sorry for babbling Daniel :-) , my use of all this terminology is
still growing (I hope). Anyway, I sorted it out thanks to your brief
description above. Trying to do too much twisting and turning lol.

Cheers


On Dec 3, 11:24 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 3, 3:25 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am trying to use ForeignKey data returned from a page and view, and
> > am having trouble. I am missing something fundamental I think.
>
> > Say I have 2 models
>
> > class TopModel(models.Model):
> >         name = models.CharField(max_length=50)
> >         db_type = models.CharField(max_length=1, choices=STATUS_DBS)
>
> > # and another class with an FK to the above
>
> > class OtherModel(models.Model):
> >         name = models.CharField(max_length=50)
> >         topmodel = models.ForeignKey(TopModel)
>
> > # Form classes for the above are just as follows:
>
> > class TopModelForm(forms.ModelForm):
>
> >     class Meta:
> >             model = TopModel
>
> > class OtherModel(forms.ModelForm):
>
> >     class Meta:
> >             model = OtherModel
>
> > Anyway, if I go to a page template and view for OtherModel, say the
> > user selects an fk for TopModel in OtherModel,
> > I want to get back the actual fk number , e.g, 3, 10, 1, or whatever
> > from the post dict. I currently do not get a value back for this (or
> > I am calling it the wrong thing or something).
>
> > I just want the Interger id for the fk that would be in the db). I
> > want to use this type of access several layers deep in cases,
> > and this seems like it should be dirt simple (it would be the old
> > school way), but of course, I am trying to get away from that.
>
> > I have been looking through the docs and things and just confusing
> > myself
> > more and more.
>
> > So, can anyone tell me what I am doing wrong or if there is an easy
> > (and efficient) way to do this, or perhaps point me to a piece of
> > actual code that does something similar.
>
> > Thanks very much,
>
> > Peter
>
> Sorry, I'm not able to understand what your issue is. What do you mean
> by 'going to a page template' and 'getting back' an FK?
>
> I think you need to explain your use case a bit more. A ModelForm is
> basically for editing and creating instances of a model. Are you
> trying to use it for navigation? Maybe an example of your view might
> help.
> --
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django and favicon.ico problem

2008-12-17 Thread Peter Herndon

I've done favicons as per Malcolm's suggestion, with a link in my base
template to e.g. /media/images/favicon.ico, and that works
satisfactorily for most cases.  The favicon shows as expected in
browser address bars, etc.

However, since favicons arose via convention, where the convention was
to place them in the root of the server, some old and/or stupid UAs
still request them at /, rather than following the link.  Which means
I've received 404 emails.

I haven't bothered to try fixing it yet, but I wonder if a redirect
from /favicon.ico to /media/images/favicon.ico might solve that issue.
 If I get a chance I'll test it today, see if works.  Has anyone else
experimented with this?

---Peter

On 12/16/08, Malcolm Tredinnick  wrote:
>
>
> On Tue, 2008-12-16 at 02:45 -0800, architecture wrote:
>> i was working with php and always i put the favicon.ico in the root of
>> the website but now the problem with django occurs
>> now i'm working with django and i have a problem now
>> i used
>> 1. static.serve
>> 2. .htaccess
>> 3.redirect_to
>>
>> but none of them works have you any idea for using favicon.ico in the
>> website
>
> There's nothing Django or PHP-specific about setting this up. However,
> if you've configured your Django installation to control everything
> under "/", then you'll need to make sure it also responds to request for
> favico.
>
> An even easier solution is simply to put the favicon file wherever you
> serve other static data from (e.g. where your stylesheets and images
> are) and put a  line in your base template to point
> clients to the right location.
>
> 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: Custom form/formset for edit inline

2008-12-18 Thread Peter Shafer

I'm also having the same problem as Emil.  I have pictures that belong
to galleries so I use inline forms to manage them.  I also use the
drag-drop script to order these images.  Since images have so many
attributes though, the size of the inline form becomes pretty
unmanageable.

Here is my admin.py
http://dpaste.com/100468/

I don't get any errors, but my inline forms remain unchanged.

Peter

On Nov 17, 10:33 am, Ben Gerdemann  wrote:
> I'm having exactly the same problem which I posted about 
> herehttp://groups.google.com/group/django-users/browse_thread/thread/bb4c...
> Have you figured out how to do this? Yours is the third message I've
> read by someone trying to customize an inline form without any
> solution. I'm beginning to think this probably isn't possible in 
> theadmininterface... :(

--~--~-~--~~~---~--~~
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: Custom form/formset for edit inline

2008-12-18 Thread Peter Shafer

It seems to be working now once I made the following changes to
admin.py http://dpaste.com/100570/

On Dec 18, 1:56 pm, Peter Shafer  wrote:
> I'm also having the same problem as Emil.  I have pictures that belong
> to galleries so I use inline forms to manage them.  I also use the
> drag-drop script to order these images.  Since images have so many
> attributes though, the size of the inline form becomes pretty
> unmanageable.
>
> Here is my admin.pyhttp://dpaste.com/100468/
>
> I don't get any errors, but my inline forms remain unchanged.
>
> Peter
>
> On Nov 17, 10:33 am, Ben Gerdemann  wrote:
>
> > I'm having exactly the same problem which I posted about 
> > herehttp://groups.google.com/group/django-users/browse_thread/thread/bb4c...
> > Have you figured out how to do this? Yours is the third message I've
> > read by someone trying to customize an inline form without any
> > solution. I'm beginning to think this probably isn't possible in 
> > theadmininterface... :(
>
>
--~--~-~--~~~---~--~~
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-like PHP framework?

2009-01-05 Thread Peter Bailey

You might want to have a look at CakePHP. It follows the MCV pattern I
believe, although I have not looked closely because it is PHP not
Python.

http://cakephp.org/

Peter


On Jan 5, 8:31 am, "thi.l...@gmail.com"  wrote:
> Hi,
>
> I have a hard time getting Django adopted as web framework in the
> office.
> Mostly because the boss paid for PHP-based trainings, and our current
> infrastructure leaves little room for mod_python/wsgi/fastcgi...
>
> I was wondering if some fo you know about competitor PHP frameworks
> that "look like" Django, or at least try to reach that level of
> purity.
>
> Thanks for any comment (and sorry about this unfair request :-P)
--~--~-~--~~~---~--~~
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: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Peter Herndon

"Practical Django Projects" is a bit dated at the moment -- Django has
been moving very quickly.  However, there's a lot to learn from it,
particularly regarding structuring your applications to be reusable,
and lots of other best practices.

I'm in the middle of "Python Web Development with Django" by Jeff
Forcier, Paul Bissex and Wesley Chun, and while it almost covers 1.0,
it was obviously written mostly before 1.0 and updated as and when
possible.  The lag time between manuscript completion and printing is
long, so it's hard to be current considering Django's velocity.  That
said, it is a very good book, with some really good information in it.

Admittedly I'm something of an infovore, so my response should be
taken with a grain of salt, but if you have the time I'd recommend you
work through Forcier, et al. and refer back to the online
documentation as needed to flesh out individual topics.  *Then* go
back and take in James' book, sifting through it for the
still-relevant pieces.  But, if you've worked through the online
tutorial, your best teacher will be a comprehensive project of your
own.  Pick something that you need, and write it.  Refer back to the
online docs for specifics, and ask questions as needed to fill in the
blanks and keep you headed in the right direction.  Experience is the
best teacher, and if you already know Python reasonably well, Django
will fit your Pythonic expectations well.

On Mon, Jan 5, 2009 at 9:42 AM, brad  wrote:
>
>
> On Jan 5, 2:21 am, HB  wrote:
>> Do you recommend "Practical Django Projects" instead?
>
> I got this book as soon as it came out, and very soon after Django hit
> 1.0.  It's a good book, and I learned a few "big picture" ideas from
> the sample apps, but I really had to read the docs to figure out how
> to do the specifics.
>
> If you're looking for the "big picture", grab it from a library or
> borrow it from a friend.. otherwise, wait for the next edition or just
> read the docs (which are very excellent, btw).
>
> >
>

--~--~-~--~~~---~--~~
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: Unique Case Sensitivity

2008-07-16 Thread Peter Melvyn

On Wed, Jul 16, 2008 at 3:06 AM, Russell Keith-Magee
<[EMAIL PROTECTED]> wrote:

> I strongly suspect that the problem here is MySQL - in particular, the
> collation on your text field. There are certain default setups for
> MySQL which will result in all text fields being case insensitive.
> This doesn't just affect unique constraints - it affects case
> sensitive matching as well.

Not only default setups. See
http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html
for available collations - all collations are case insensitive except
the xxx_bin one.

You can try in...


Peter

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey

Hi all. I am attempting to convert an app I am writing to use the nfa.
I have looked at all the docs available about this, but must have
missed something. I am using:

Django version 1.0-alpha-SVN-8053

Anyway, I have changed my urls.py file to be like so:

from django.contrib import admin

(r'^admin/(.*)', admin.site.root),  # in urlpatterns

and in my models file I have:

from django.contrib import admin

and then after my Page class declaration I have

admin.site.register(Page)

which creates the following error at runtime:

ImproperlyConfigured at /
Error while importing URLconf 'generator.urls': The model Page is
already registered

I have tried using the autodiscover and not using it - same result - I
also see some people are using an admin.py file and some are just
modifying the model.py file.

Can anyone point me at some info or tell me what I am doing wrong.
Feeling kinda stupid about now...

Thanks,

Peter



--~--~-~--~~~---~--~~
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: Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey

That works much better Malcolm, thank you very much. Appreciate the
explanations too.

Cheers,

Peter


On Jul 22, 3:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-22 at 12:21 -0700, Peter Bailey wrote:
> > Hi all. I am attempting to convert an app I am writing to use the nfa.
> > I have looked at all the docs available about this, but must have
> > missed something. I am using:
>
> > Django version 1.0-alpha-SVN-8053
>
> > Anyway, I have changed my urls.py file to be like so:
>
> > from django.contrib import admin
>
> >     (r'^admin/(.*)', admin.site.root),  # in urlpatterns
>
> > and in my models file I have:
>
> > from django.contrib import admin
>
> > and then after my Page class declaration I have
>
> > admin.site.register(Page)
>
> > which creates the following error at runtime:
>
> > ImproperlyConfigured at /
> > Error while importing URLconf 'generator.urls': The model Page is
> > already registered
>
> > I have tried using the autodiscover and not using it - same result - I
> > also see some people are using an admin.py file and some are just
> > modifying the model.py file.
>
> > Can anyone point me at some info or tell me what I am doing wrong.
> > Feeling kinda stupid about now...
>
> The recommended approach (and the reason for autodiscover()) is to put
> the admin classes and registration into admin.py. Your models.py files
> are imported more than once, which is leading to the duplicate
> registration error (which is a real error in other situations, which is
> why it exists).
>
> Putting things in admin.py is a way to make sure they're only registered
> once.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



More advanced test runner available?

2008-08-25 Thread Peter Bengtsson

Is there an alternative to the test runner that comes by defauly with
Django (svn version)? The one that you get doesn't have colour coding
and it doesn't have the option to stop all other tests after the first
failure.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Discover tests in forms.py

2008-09-04 Thread Peter Bengtsson

>From http://www.djangoproject.com/documentation/testing/
"4. Looking for unit tests and doctests in the models.py and tests.py
files in each installed application."

Next to models.py I have forms.py which does exactly what the filename
suggests: it defines forms. I've put some doctests in these classes.
How do I get the testrunner to discover them?


--~--~-~--~~~---~--~~
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: Discover tests in forms.py

2008-09-04 Thread Peter Bengtsson


> If your looking for an example to follow, the code for
> django.test.simple isn't too hard to tear apart and customize for your
> own purposes.

OK. Here's how I solved it:

from django.test.simple import *
from django.test.simple import run_tests as orig_run_tests

# my app is called 'classes'
import classes.forms
def run_tests(test_labels, verbosity=1, interactive=True,
extra_tests=[]):
d = locals()
d.pop('test_labels')
extra_tests.append(build_suite(classes.forms))
return orig_run_tests(test_labels, **d)

That works great and I now need to make it non-hardcoded. I like how
it doesn't repeat the code from simple.py much which is key to me for
new upgrades of django itself.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem with filtering on DateTimeField

2008-09-05 Thread Peter Bengtsson

I've got something like this:

 class Class(models.Model):
  ...
  date = models.DateTimeField()

I'm trying to filter and get all objects on a particular day:

 >>> Class.objects.all()[0].date
 datetime.datetime(2008, 9, 4, 15, 10, 23, 359032)
 >>> Class.objects.filter(date=datetime(2008,9,4)).count()
 0

This is unexpected. Clearly there is one object in there on the same
day, but obviously at a different hour.
I've also tried date__exact= and date__startswith= but no luck with
either. I know it's possible to do things like date__year=,
date__month=, date__day= but that feels a bit excessive.

At the moment I've solved my problem by doing a __range but I really
want to know why it doesn't work.

Peter

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Stupid noob question - admin link

2008-09-09 Thread Peter Bailey

Hi all, starting to think there is so much stuff in django and python
that I will never learn it all. I am building a site that used the
admin piece for most of the CRUD and a few other pages for the rest of
my requirements. I link to the admin from my main app page, and would
like to be able to link back the other way. Don't see an obvious way
to do this. Can anyone tell me a easy way to add a hyperlink from the
main admin page to somewhere else outside the admin app.

Thanks, and sorry for the dumb question.

Peter


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   3   4   5   6   7   8   9   10   >