Re: Remove a field in a form subclass

2010-04-27 Thread creecode
Hello Wiiboy,

Take a look at the excellent writing "Dynamic form generation" <
http://jacobian.org/writing/dynamic-form-generation/ > by Jacob Kaplan-
Moss.  It may help you.

I had a similar need to yours and ended up using the __init__ method
to remove fields.

Toodle-l.
creecode

On Apr 27, 4:29 pm, Wiiboy  wrote:

> Is there a way to remove it in subclasses?

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



django tinymce/filebrowser issue

2010-04-27 Thread Bobby Roberts
hey group -

I've installed djangotinymce and filebrowser per the instructions.
I've run across a strange issue.  When I go to insert an image, the
image dialog pops up just fine with the button for filebrowser.
However, when I click the filebrowser button, nothing happens.  Any
idea what could be causing that?

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



Recommendations for a twitter oauth library?

2010-04-27 Thread adamjamesdrew
Hi has anyone found a good twitter oauth library for django?

-- 
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: Getting a Blog included in the Django community aggregator

2010-04-27 Thread Russell Keith-Magee
On Wed, Apr 28, 2010 at 3:49 AM, Rob  wrote:
> By strange coincidence, I sent an email to Jacob earlier today
> requesting that my blog be included in the Django community
> aggregator.
>
> I had a suspicion that this type of situation might arise, as I expect
> many are doing the same.
>
> My blog address is http://www.robgolding.com/blog and the RSS feed for
> Django is http://www.robgolding.com/blog/feed/?tag=django. It would be
> really great if my content could be included :).

Done.

To answer the broader question: We've got some changes in the works
for the community pages which will mean you'll be able to manage your
own blog registrations on the Django website. Hopefully this will be
just the first of a bunch of updates coming in the near future.

Yours,
Russ Magee %-)

-- 
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: Static media in development server

2010-04-27 Thread Jonathan Hayward
Thank you; right now I am using the development server (i.e. not deployed to
Apache for real use).

I added the FILE_UPLOAD_PERMISSIONS assignment to settings.py and can't
observe a difference in behavior.

On Tue, Apr 27, 2010 at 7:37 PM, Nadae Ivar Badio wrote:

> Hi,
>
> Use this FILE_UPLOAD_PERMISSIONS = 0600
> and you have to give permissions to apache to read the file upload
> directory.
>
>
>
>
> Jonathan Hayward wrote:
>
>> The file permissions are right AFAIK; the directory is mode 755 and the
>> file 644, owned by the user running the server, so accessing and reading
>> shouldn't be a problem.
>>
>> Are you using Django installed through the package manager or the latest
>> release from djangoproject.com ?
>>
>>
>> On Tue, Apr 27, 2010 at 6:37 PM, Xavier Ordoquy > xordo...@linovia.com>> wrote:
>>
>>It is pretty much what I also have and works both on ubuntu 9.10
>>32 bits and osx.
>>
>>Did you checked that your media directory exists and lives in the
>>same directory as the settings.py ?
>>Also check that you have the right permissions for accessing it
>>with the user that runs the dev server.
>>
>>Regards,
>>Xavier.
>>
>>Le 28 avr. 2010 à 01:00, Jonathan Hayward a écrit :
>>
>> Thank you!
>>>
>>>Right now, I have, in settings.py:
>>>
>>>MEDIA_ROOT =
>>>os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')
>>>
>>>MEDIA_URL = '/media/'
>>>
>>>And at the end of urls.py:
>>>
>>>if settings.DEBUG:
>>>urlpatterns += patterns('django.views.static',
>>>  (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
>>>'document_root': settings.MEDIA_ROOT,
>>>'show_indexes': True }),)
>>>
>>>But I'm still getting a "not found" error when I try to load a
>>>picture from the media directory. I am also getting "Permission
>>>denied: /media/" when I load the root media URL.
>>>
>>>I'm on an Ubuntu32 9.10 system, so even if I should be specifying
>>>a virgule instead of os.path.join(), the path should be forward
>>>slash separated. Is there anything that looks askew about the
>>>code above?
>>>
>>>On Tue, Apr 27, 2010 at 5:28 PM, Xavier Ordoquy
>>>mailto:xordo...@linovia.com>> wrote:
>>>
>>>Hi,
>>>
>>>Here's something better for your dev server:
>>>
>>>from django.conf import settings
>>>
>>>if settings.DEBUG:
>>>urlpatterns += patterns('django.views.static',
>>>(r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
>>>
>>> 'document_root': settings.MEDIA_ROOT,
>>>
>>> 'show_indexes': True }),)
>>>
>>>
>>>To answer your question, you should
>>>use os.path.abspath(os.path.dirname(__file__)) instead of
>>>os.path.dirname(__file__).
>>>
>>>Regards,
>>>Xavier.
>>>
>>>
>>>Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :
>>>
>>> I'm trying to serve up media from a document_root of
/media via, in urls.py:

urlpatterns = patterns('',
...
(r'^media/(?P.*)$', 'django.views.static.serve',
  {'document_root':
os.path.join(os.path.dirname(__file__), 'media')}),
...

It gives a "file not found" error, either this way or if I
add a trailing slash.

How can I serve up static content from >>>name>/media/* to a URL of /media/* from the development server?

-- → Jonathan Hayward,
 christos.jonathan.hayw...@gmail.com


→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading
online:
☩ I invite you to visit my main site at
http://JonathansCorner.com/

-- You received this message because you are subscribed
 to the
Google Groups "Django users" group.
To post to this group, send email to
django-users@googlegroups.com
.

To unsubscribe from this group, send email to

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

Re: Static media in development server

2010-04-27 Thread Nadae Ivar Badio

Hi,

Use this FILE_UPLOAD_PERMISSIONS = 0600
and you have to give permissions to apache to read the file upload 
directory.





Jonathan Hayward wrote:
The file permissions are right AFAIK; the directory is mode 755 and 
the file 644, owned by the user running the server, so accessing and 
reading shouldn't be a problem.


Are you using Django installed through the package manager or the 
latest release from djangoproject.com ?


On Tue, Apr 27, 2010 at 6:37 PM, Xavier Ordoquy > wrote:


It is pretty much what I also have and works both on ubuntu 9.10
32 bits and osx.

Did you checked that your media directory exists and lives in the
same directory as the settings.py ?
Also check that you have the right permissions for accessing it
with the user that runs the dev server.

Regards,
Xavier.

Le 28 avr. 2010 à 01:00, Jonathan Hayward a écrit :


Thank you!

Right now, I have, in settings.py:

MEDIA_ROOT =
os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')

MEDIA_URL = '/media/'

And at the end of urls.py:

if settings.DEBUG:
urlpatterns += patterns('django.views.static',
  (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True }),)

But I'm still getting a "not found" error when I try to load a
picture from the media directory. I am also getting "Permission
denied: /media/" when I load the root media URL.

I'm on an Ubuntu32 9.10 system, so even if I should be specifying
a virgule instead of os.path.join(), the path should be forward
slash separated. Is there anything that looks askew about the
code above?

On Tue, Apr 27, 2010 at 5:28 PM, Xavier Ordoquy
mailto:xordo...@linovia.com>> wrote:

Hi,

Here's something better for your dev server:

from django.conf import settings

if settings.DEBUG:
urlpatterns += patterns('django.views.static',
(r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
  
 'document_root': settings.MEDIA_ROOT,
  
 'show_indexes': True }),)



To answer your question, you should
use os.path.abspath(os.path.dirname(__file__)) instead of
os.path.dirname(__file__).

Regards,
Xavier.


Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :


I'm trying to serve up media from a document_root of
/media via, in urls.py:

urlpatterns = patterns('',
...
(r'^media/(?P.*)$', 'django.views.static.serve',
  {'document_root':
os.path.join(os.path.dirname(__file__), 'media')}),
...

It gives a "file not found" error, either this way or if I
add a trailing slash.

How can I serve up static content from /media/* to a URL of /media/* from the development server?

-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com


→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading
online:
☩ I invite you to visit my main site at
http://JonathansCorner.com/

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

Google Groups "Django users" group.
To post to this group, send email to
django-users@googlegroups.com
.
To unsubscribe from this group, send email to
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.




-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com


→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

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

Google Groups "Django users" group.
To post to this gr

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
The file permissions are right AFAIK; the directory is mode 755 and the file
644, owned by the user running the server, so accessing and reading
shouldn't be a problem.

Are you using Django installed through the package manager or the latest
release from djangoproject.com?

On Tue, Apr 27, 2010 at 6:37 PM, Xavier Ordoquy wrote:

> It is pretty much what I also have and works both on ubuntu 9.10 32 bits
> and osx.
>
> Did you checked that your media directory exists and lives in the same
> directory as the settings.py ?
> Also check that you have the right permissions for accessing it with the
> user that runs the dev server.
>
> Regards,
> Xavier.
>
> Le 28 avr. 2010 à 01:00, Jonathan Hayward a écrit :
>
> Thank you!
>
> Right now, I have, in settings.py:
>
> MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)),
> 'media')
>
> MEDIA_URL = '/media/'
>
> And at the end of urls.py:
>
> if settings.DEBUG:
> urlpatterns += patterns('django.views.static',
>   (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
> 'document_root': settings.MEDIA_ROOT,
> 'show_indexes': True }),)
>
> But I'm still getting a "not found" error when I try to load a picture from
> the media directory. I am also getting "Permission denied: /media/" when I
> load the root media URL.
>
> I'm on an Ubuntu32 9.10 system, so even if I should be specifying a virgule
> instead of os.path.join(), the path should be forward slash separated. Is
> there anything that looks askew about the code above?
>
> On Tue, Apr 27, 2010 at 5:28 PM, Xavier Ordoquy wrote:
>
>> Hi,
>>
>> Here's something better for your dev server:
>>
>> from django.conf import settings
>>
>> if settings.DEBUG:
>> urlpatterns += patterns('django.views.static',
>> (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
>> 'document_root':
>> settings.MEDIA_ROOT,
>> 'show_indexes': True }),)
>>
>>
>> To answer your question, you should
>> use os.path.abspath(os.path.dirname(__file__)) instead of
>> os.path.dirname(__file__).
>>
>> Regards,
>> Xavier.
>>
>>
>> Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :
>>
>> I'm trying to serve up media from a document_root of /media
>> via, in urls.py:
>>
>> urlpatterns = patterns('',
>> ...
>> (r'^media/(?P.*)$', 'django.views.static.serve',
>>   {'document_root': os.path.join(os.path.dirname(__file__),
>> 'media')}),
>> ...
>>
>> It gives a "file not found" error, either this way or if I add a trailing
>> slash.
>>
>> How can I serve up static content from /media/* to a URL of
>> /media/* from the development server?
>>
>> --
>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>> → An Orthodox Christian author: theology, literature, et cetera.
>> → My award-winning collection is available for free reading online:
>> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-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.
>>
>>
>>
>> --
>> 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.
>>
>
>
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>
>
>  --
> 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.
>



-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/


Many2Many / Generic Relation filter, doesn't behave like expected, how is the right way to do it?

2010-04-27 Thread HWM-Rocker
I have a TaggedObject that has a GenericRelation to Foo with the name
tags. When I am searching something like that

TaggedObject.objects.filter(Q(tags__tag=1)&Q(tags__tag=4))

I get no Objects in return. But when I filter with (or) '|' then I get
4 Objects. But I have only 3 objects tagged. So the object, that was
tagged with 1 and with 4 will be returned twice?

Thats strange. Any idea how to create this queries correctly?

thanks in advance!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Static media in development server

2010-04-27 Thread Xavier Ordoquy
It is pretty much what I also have and works both on ubuntu 9.10 32 bits and 
osx.

Did you checked that your media directory exists and lives in the same 
directory as the settings.py ?
Also check that you have the right permissions for accessing it with the user 
that runs the dev server.

Regards,
Xavier.

Le 28 avr. 2010 à 01:00, Jonathan Hayward a écrit :

> Thank you!
> 
> Right now, I have, in settings.py:
> 
> MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')
> 
> MEDIA_URL = '/media/'
> 
> And at the end of urls.py:
> 
> if settings.DEBUG:
> urlpatterns += patterns('django.views.static',
>   (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
> 'document_root': settings.MEDIA_ROOT,
> 'show_indexes': True }),)
> 
> But I'm still getting a "not found" error when I try to load a picture from 
> the media directory. I am also getting "Permission denied: /media/" when I 
> load the root media URL.
> 
> I'm on an Ubuntu32 9.10 system, so even if I should be specifying a virgule 
> instead of os.path.join(), the path should be forward slash separated. Is 
> there anything that looks askew about the code above?
> 
> On Tue, Apr 27, 2010 at 5:28 PM, Xavier Ordoquy  wrote:
> Hi,
> 
> Here's something better for your dev server:
> 
> from django.conf import settings
> 
> if settings.DEBUG:
> urlpatterns += patterns('django.views.static',
> (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
> 'document_root': 
> settings.MEDIA_ROOT,
> 'show_indexes': True }),)
> 
> 
> To answer your question, you should use 
> os.path.abspath(os.path.dirname(__file__)) instead of 
> os.path.dirname(__file__).
> 
> Regards,
> Xavier.
> 
> 
> Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :
> 
>> I'm trying to serve up media from a document_root of /media 
>> via, in urls.py:
>> 
>> urlpatterns = patterns('',
>> ...
>> (r'^media/(?P.*)$', 'django.views.static.serve',
>>   {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
>> ...
>> 
>> It gives a "file not found" error, either this way or if I add a trailing 
>> slash.
>> 
>> How can I serve up static content from /media/* to a URL of 
>> /media/* from the development server?
>> 
>> -- 
>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>> → An Orthodox Christian author: theology, literature, et cetera.
>> → My award-winning collection is available for free reading online:
>> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-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.
> 
> 
> -- 
> 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.
> 
> 
> 
> -- 
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.

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



Remove a field in a form subclass

2010-04-27 Thread Wiiboy
Hi guys,
I've got a ModelForm defined like below:
class ArticleForm(forms.ModelForm):
title = forms.CharField(stuff)
def custom_validator():
..
class Meta:
model = Article

I want to subclass it, but do _not_ want the title field, i.e.
class SubArticleForm(ArticleForm):
 class Meta:
  fields = [...anything but 'title'...]
But the title field still shows up.  Is there a way to remove it in
subclasses?

-- 
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: Increase number of rows of a formset dynamically

2010-04-27 Thread Sonal Breed
Following link helped me solve the problem:
http://stackoverflow.com/questions/2448970/django-adding-inline-formset-rows-without-javascript

On Apr 27, 10:31 am, Sonal Breed  wrote:
> Hello all,
>
> I have a ModelFormSet defined as
>
> RowFormSet = modelformset_factory(Row, extra=7)
>
> The requirement is to give user capability to add more rows to the
> displayed form so that now total number of rows in the formset
> increases by 1.
> Can we dynamically add more rows to the formset? If so, how can we
> achieve it.
>
> Thanks in advance,
> Sincerely,
> Sonal.
>
> --
> 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.



Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
Thank you!

Right now, I have, in settings.py:

MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'media')

MEDIA_URL = '/media/'

And at the end of urls.py:

if settings.DEBUG:
urlpatterns += patterns('django.views.static',
  (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
'document_root': settings.MEDIA_ROOT,
'show_indexes': True }),)

But I'm still getting a "not found" error when I try to load a picture from
the media directory. I am also getting "Permission denied: /media/" when I
load the root media URL.

I'm on an Ubuntu32 9.10 system, so even if I should be specifying a virgule
instead of os.path.join(), the path should be forward slash separated. Is
there anything that looks askew about the code above?

On Tue, Apr 27, 2010 at 5:28 PM, Xavier Ordoquy wrote:

> Hi,
>
> Here's something better for your dev server:
>
> from django.conf import settings
>
> if settings.DEBUG:
> urlpatterns += patterns('django.views.static',
> (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
> 'document_root':
> settings.MEDIA_ROOT,
> 'show_indexes': True }),)
>
>
> To answer your question, you should
> use os.path.abspath(os.path.dirname(__file__)) instead of
> os.path.dirname(__file__).
>
> Regards,
> Xavier.
>
>
> Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :
>
> I'm trying to serve up media from a document_root of /media
> via, in urls.py:
>
> urlpatterns = patterns('',
> ...
> (r'^media/(?P.*)$', 'django.views.static.serve',
>   {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
> ...
>
> It gives a "file not found" error, either this way or if I add a trailing
> slash.
>
> How can I serve up static content from /media/* to a URL of
> /media/* from the development server?
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>
>
>  --
> 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.
>



-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Static media in development server

2010-04-27 Thread Xavier Ordoquy
Hi,

Here's something better for your dev server:

from django.conf import settings

if settings.DEBUG:
urlpatterns += patterns('django.views.static',
(r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),  'serve', {
'document_root': 
settings.MEDIA_ROOT,
'show_indexes': True }),)


To answer your question, you should use 
os.path.abspath(os.path.dirname(__file__)) instead of os.path.dirname(__file__).

Regards,
Xavier.


Le 28 avr. 2010 à 00:00, Jonathan Hayward a écrit :

> I'm trying to serve up media from a document_root of /media 
> via, in urls.py:
> 
> urlpatterns = patterns('',
> ...
> (r'^media/(?P.*)$', 'django.views.static.serve',
>   {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
> ...
> 
> It gives a "file not found" error, either this way or if I add a trailing 
> slash.
> 
> How can I serve up static content from /media/* to a URL of 
> /media/* from the development server?
> 
> -- 
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.

-- 
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: Django DatabaseError when using sqlall and syncdb

2010-04-27 Thread larsendt
Aha! Fixed it.

I commented out all of the apps I added to the project, and then ran ./
manage.py syncdb, then I had to uncomment each app and sync one by
one.

I think my problem was that I had one app depending on the other, and
that was causing the error.

Dane Larsen

On Apr 26, 9:49 pm, larsendt  wrote:
> I'm having issues creating a newdatabasefor my app. I'm using the
> Django 1.2 beta.
> I wrote the "people" app on another computer, and now I'm trying to
> get it working on a little server I have set up.
> When I try:
>
>     ./manage.py sqlall people
>
> I get theerror:
>
>     django.db.utils.DatabaseError: (1146, "Table
> 'peace_tracker_db.people_person' doesn't exist")
>
> I have already created the db in MySQL.
> The same thing happens when I use ./manage.py syncdb
>
> From what I've read elsewhere, there's a bug that has a similar effect
> when using multiple databases, but I am only using onedatabase.
>
> Any suggestions?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.



Static media in development server

2010-04-27 Thread Jonathan Hayward
I'm trying to serve up media from a document_root of /media
via, in urls.py:

urlpatterns = patterns('',
...
(r'^media/(?P.*)$', 'django.views.static.serve',
  {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
...

It gives a "file not found" error, either this way or if I add a trailing
slash.

How can I serve up static content from /media/* to a URL of
/media/* from the development server?

-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Django DatabaseError when using sqlall and syncdb

2010-04-27 Thread larsendt
Thanks for the reply.

So here's what I just did.

In MySQL I did:

DROP DATABASE peace_tracker_db;

Then I did:

CREATE_DATABASE peace_tracker_db;

Then:

python manage.py syncdb

Which gave me the error:

django.db.utils.DatabaseError: (1146, "Table
'peacetracker_db.people_person' doesn't exist")

I then tried:

python manage.py sqlall people

But that gave me the same error. I checked the username and password
for the db, but they're correct.
I changed them, just to be sure, and got the expected "access denied"
error.

I created a test project on the server and it worked fine. The
database sync'd fine, no errors.

I've scoured the settings in my main project, but I have no idea what
could causing the errors.

Anyway, thanks in advance,
Dane Larsen

On Apr 27, 8:12 am, Fred Chevitarese  wrote:
> Hi!
>
> As you said, you´ve created a new database, or you created a database and
> restore a backup ?
> Try to create a new and after this, run syncdb.
>
> http://chevitarese.wordpress.com
> Fred Chevitarese - GNU/Linux
>
> 2010/4/27 larsendt 
>
>
>
>
>
> > I'm having issues creating a new database for my app. I'm using the
> > Django 1.2 beta.
> > I wrote the "people" app on another computer, and now I'm trying to
> > get it working on a little server I have set up.
> > When I try:
>
> >    ./manage.py sqlall people
>
> > I get the error:
>
> >    django.db.utils.DatabaseError: (1146, "Table
> > 'peace_tracker_db.people_person' doesn't exist")
>
> > I have already created the db in MySQL.
> > The same thing happens when I use ./manage.py syncdb
>
> > From what I've read elsewhere, there's a bug that has a similar effect
> > when using multiple databases, but I am only using one database.
>
> > Any suggestions?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.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-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.



Re: usage of TIME_ZONE and zone-to-zone conversion

2010-04-27 Thread Shawn Milochik

On Apr 27, 2010, at 3:36 PM, Peter Herndon wrote:

> Hi Shawn,
> 
> http://pytz.sourceforge.net/ looks like it would be useful for converting 
> time zone strings.
> 
> The one thing I keep hearing, though, whenever anyone brings up time zones 
> here on django-users is:  "*ALWAYS* store dates in UTC, then convert as 
> needed".  Don't know how useful that is, but for what it's worth, *whump*, 
> there it is.  :)
> 
> ---Peter Herndon

Thanks for the tip on pytz. It might be what I need.

As for the other part of your note, I completely agree with the sentiment. The 
problem is that, in a standard Django installation, there's an inherent 
timezone defined in settings.py. Given a time from a third party, with a known 
(different) time zone, it still has to be converted to UTC or the local 
timezone, and for that I need to be able to derive a timedelta from those 
verbose time zone names.

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



permissions like widget to add users to groups

2010-04-27 Thread Preston Holmes
Has anyone adapted the interfaced used for adding permissions to a
group/user to allow one to add users to a group?

How reusable is the CSS/JS?

-Preston

-- 
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: Run external script with Django cron

2010-04-27 Thread Shawn Milochik
> 
> And what is difference between PATH and PYTHONPATH?

Appending to your environment's PATH means you'll be able to execute files 
without specifying the full path. For example, instead of having to do 
./filename.py you can just use filename.py to call a Python script. This is 
just a *nix thing.

Appending to PYTHONPATH means that, from within Python, you'll be able to 
import modules from that new path. That's a Python thing, but as specified in 
your *nix environment.

If your problem is with your PATH, then the environment within which your cron 
job is running doesn't know where the script you're trying to run is. Since the 
error you mentioned seems to indicate that it can't find a .py file, then that 
might be the case.

If the problem is with your PYTHONPATH, then the Python instance in the 
environment within which your cron job is running isn't aware of the directory 
where your scripts live. Although it seems you already know this, the directory 
in your PYTHONPATH must include an __init__.py file.

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



Re: Oracle cursor.execute problem

2010-04-27 Thread Tim Sawyer

Ian wrote:

On Apr 25, 11:13 am, Tim Sawyer  wrote:


 >>> import cx_Oracle
 >>> from django.db import connection
 >>> cursor = connection.cursor()
 >>> lOutput = cursor.var(cx_Oracle.STRING)
 >>> cursor.execute("BEGIN %s := 'N'; END;", [lOutput])
Traceback (most recent call last):
   File "", line 1, in 
   File "/home/...snip.../django/db/backends/oracle/base.py", line 349,
in execute
 raise e
DatabaseError: ORA-06550: line 1, column 23:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of
the following:
;  
The symbol ";" was substituted for "end-of-file" to continue.


The trailing semicolon is automatically stripped by the backend, which
is necessary for most of the queries it runs but incorrect for PL/
SQL.  The easiest fix is to add a space or a second semicolon at the
end.  Or you can do what Django does internally, which is to terminate
the PL/SQL block with a forward-slash on its own line after the
semicolon, as if the block were to be entered into sqlplus.  In that
case the forward-slash will be stripped, but the semicolon will be
left alone.

HTH,
Ian



Hmm, nearly.  That gets around the error, but the return value isn't 
populated.


>>> import cx_Oracle
>>> from django.db import connection
>>> cursor = connection.cursor()
>>> lOutput = cursor.var(cx_Oracle.STRING)
>>> cursor.execute("BEGIN %s := 'N'; END; ", [lOutput])
>>> print lOutput

>>> print lOutput.getvalue()
None
>>>

Any more clues, or am I just going to have to stick with creating a 
specific Oracle connection to do this?


Cheers,

Tim.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-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: Run external script with Django cron

2010-04-27 Thread Alexis Selves


On 27 dub, 22:26, Shawn Milochik  wrote:
> I don't understand what the problem is. What error message are you getting?
>
> Are you confusing PATH and PYTHONPATH?
>
> 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.



Re: Run external script with Django cron

2010-04-27 Thread Alexis Selves
problem is, that I cannot import file db.py to another python script
pokus.py when i try to execute my pokus.py I got this:
home/
petarda/pokus.py does not point to a directory

Is it clear now?

And what is difference between PATH and PYTHONPATH?
Thanks for help.

On 27 dub, 22:26, Shawn Milochik  wrote:
> I don't understand what the problem is. What error message are you getting?
>
> Are you confusing PATH and PYTHONPATH?
>
> 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.



Re: Run external script with Django cron

2010-04-27 Thread Shawn Milochik
I don't understand what the problem is. What error message are you getting?

Are you confusing PATH and PYTHONPATH?

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



Re: Interesting Django or Python Issue

2010-04-27 Thread Kenneth Loafman
Ping.  Anyone?

Kenneth Loafman wrote:
> Folks,
> 
> I have a user command that runs, via cron, twice hourly with multiple
> threads and queues.  At the end of the run, I wait for all of the queues
> to empty and join all of the threads.  I close Xapian, print some log
> info, and delete the pid file so another instance can run.  All of this
> is completed (log file entries and pid file deleted), yet about 3 times
> a day, Django does not exit, leaving the task in memory, but idle.
> 
> I've scratched my head over this but am getting nowhere fast.  Other
> than eating up memory, it does no harm as long as I go in and clean out
> the old tasks, but this is getting old.
> 
> Has anyone else seen this behavior?  Any idea how to debug it?
> 
> Environment is:
> Ubuntu Karmic
> Django 1.1.1-1ubuntu1
> Python 2.6
> MySQL 5.1
> 
> ...Thanks,
> ...Ken
> 

-- 
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: Getting a Blog included in the Django community aggregator

2010-04-27 Thread Rob
By strange coincidence, I sent an email to Jacob earlier today
requesting that my blog be included in the Django community
aggregator.

I had a suspicion that this type of situation might arise, as I expect
many are doing the same.

My blog address is http://www.robgolding.com/blog and the RSS feed for
Django is http://www.robgolding.com/blog/feed/?tag=django. It would be
really great if my content could be included :).

Thanks,
Rob Golding

On Apr 21, 9:32 am, Russell Keith-Magee 
wrote:
> On Wed, Apr 21, 2010 at 4:28 PM, Daniel Roseman  wrote:
> > On Apr 20, 3:36 pm, Russell Keith-Magee 
> > wrote:
> >> Obviously this isn't an isolated problem - I'll see what I can do
> >> about changing the advice on the community page so that Jacob's inbox
> >> doesn't become a bottleneck.
>
> >> Yours,
> >> Russ Magee %-)
>
> > Without wishing to pile on, I'm in exactly the same situation - a
> > couple of emails to Jacob have gone unanswered. My blog is at
> >http://blog.roseman.org.ukand the RSS feed for the Django tag is at
> >http://blog.roseman.org.uk/feeds/tags/django/
>
> Done. Apologies for the lack of replies.
>
> Yours,
> Russ Magee %-)
>
> --
> 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.



Run external script with Django cron

2010-04-27 Thread Alexis Selves
Hi there,
I have problem with django cron and calling external script.  I am
trying this first in another file  pokus.py:

sys.path.append('/home/petarda/Django/gheat-0.2/__/')
from bin import db

bin is child directory of '__' which contains __init__.py and db.py
which include method that I need to execute but I got this error:/home/
petarda/pokus.py does not point to a directory


Can anyone help me? Thanks in advance.

Alex

-- 
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: usage of TIME_ZONE and zone-to-zone conversion

2010-04-27 Thread Peter Herndon
Hi Shawn,

http://pytz.sourceforge.net/ looks like it would be useful for converting time 
zone strings.

The one thing I keep hearing, though, whenever anyone brings up time zones here 
on django-users is:  "*ALWAYS* store dates in UTC, then convert as needed".  
Don't know how useful that is, but for what it's worth, *whump*, there it is.  
:)

---Peter Herndon

On Apr 27, 2010, at 3:09 PM, Shawn Milochik wrote:

> Given a date/time value and a value that is valid for the TIME_ZONE setting 
> in settings.py, how do I convert that date/time to the time zone defined in 
> settings.py?
> 
> Example:
>   settings.py contains:
>   TIME_ZONE = 'America/New_York'
> 
>   Input contains:
>   date/time value "13:00"
>   time_zone = "America/Los_Angeles"
> 
>   Desired:
>   timedelta of the +/- difference needed to convert 13:00 PST to 
> 16:00 EST
> 
> It would be easy to create a dictionary of these values and their UTC offsets 
> and just use that. But before I potentially reinvent a little wheel, I was 
> wondering if this conversion was already being handled in Django. 
> 
> By looking at the Django codebase I've found the tzinfo file, but it expects 
> to receive a timedelta as input, and doesn't actually use the TIME_ZONE 
> value. Further grepping seems to indicate that the string values (such as 
> 'America/New_York') are only passed to the database engines when creating a 
> connection object so that the database itself can handle the time zones, and 
> expects the dates it receives to already have been converted to that zone.
> 
> It appears that the time and datetime Python libraries also use offsets and 
> US-centric values such as PST and EST for time zones, and not the verbose 
> names accepted by settings.py and PostgreSQL.
> 
> Thanks,
> 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 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-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: Problems with first block

2010-04-27 Thread Jonathan Hayward
Thank you, x13 and creecode!

On Tue, Apr 27, 2010 at 2:04 PM, x13  wrote:

>
> Did you read the tutorial?
> http://docs.djangoproject.com/en/1.1/topics/templates/#topics-templates
>
> Seems to be a syntax problem
>
> It's not
>
> {{ block dtd }} ... {{ endblock dtd }}
>
> the properly syntax (for last Django version) would be:
>
> {% block dtd %} ... {% endblock %}
>
> Notice you should not include 'dtd' in the endblock tag.
>
> -f
>
>
>
>
>
>
> On Apr 27, 3:51 pm, Jonathan Hayward
>  wrote:
> > I'm working on a base template. Django is giving a TemplateSyntaxError at
> my
> > first attempted block declaration:
> >
> > TemplateSyntaxError at /
> >
> > Could not parse the remainder: ' dtd' from 'block dtd'
> >
> > Request Method:GETRequest URL:http://linux:/ExceptionType:
> > TemplateSyntaxErrorException Value:
> >
> > Could not parse the remainder: ' dtd' from 'block dtd'
> >
> > Have I overgeneralized where blocks are appropriate, or is "dtd"
> something
> > like a reserved word here?
> >
> > The template is:
> >
> > {{ block dtd }} http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>{{ endblock dtd }}
> > http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> > {{ block head }}
> > {{ block title }}{{ page.title }}{{ endblock title
> }}
> > {{ block head_favicon }} href="/static/favicon.ico"
> > type="x-icon" />
> >  type="x-icon"
> > />{{ endblock head_favicon }}
> > {{ block head_meta }}
> > {{ block head_meta_author}}{{ endblock head_meta_author }}
> > {{ block head_meta_charset }} > content="text/html; charset=UTF-8" />{{ endblock head_meta_charset }}
> > {{ block head_meta_contentlanguage }} > http-equiv="Content-Language" value="en-US" />{{ endblock
> > head_meta_contentlanguage }}
> > {{ block head_meta_description }}{{ endblock
> > head_meta_description  }}
> > {{ block head_meta_keywords }}{{ endblock head_meta_keywords
> }}
> > {{ block head_meta_othertags }}{{ endblock
> head_meta_othertags}}
> >
> > {{ block head_meta_refresh }}{{ endblock head_meta_refresh }}
> > {{ block head_meta_robots }}{{ endblock head_meta_robots }}
> > {{ endblock head_meta }}
> > {{ block head_rss }}{{ endblock head_rss }}
> > {{ block head_css }}
> > {{ block head_css_site }} type="text/css"
> > href="/static/css/style.css" />{{endblock head_css_site }}
> > {{ block head_css_section }}{{ endblock head_css_section }}
> > {{ block head_css_page }}{{ endblock head_css_page }}
> > {{ endblock head_css }}
> > {{ block head_section }}{{ endblock head_section }}
> > {{ block head_page }}{{ endblock head_page }}
> > {{ endblock head }}
> > {{ block body }}
> > 
> > {{ block body_sidebar }}{{ endblock body_sidebar }}
> > 
> > 
> > {{ block body_content }}
> > 
> > {{ block body_header }}
> > {{ block body_header_banner }}{{ endblock
> body_header_banner}}
> >
> > {{ block body_header_title }}{{ title }}{{
> endblock
> > body_header_title }}
> > {{ block body_header_breadcrumb }}{{
> > endblock body_header_breadcrumb }}
> > {{ endblock body_header }}
> > 
> > {{ block body_announcements }}{{ endblock body_announcements
> }}
> > {{ block body_main }}{{ endblock body_main }}
> > {{ endblock body_content }}
> > {{ block body_footer }}
> >  {{ block body_footer_breadcrumb }}{{ page.breadcrumb }}{{ endblock
> > body_header_breadcrumb }}
> > {{ block body_footer_legal }}{{ endblock body_footer_legal }}
> > {{ endblock body_footer }}
> > {{ endblock body }}{{ block footer }}
>  {{
> > block footer_javascript }}{{ block
> footer_javascript_site}} type="text/javascript"
> >
> > src="/static/js/jquery.js">{{ endblock
> >  footer_javascript_site }}{{ block
> footer_javascript_section}}{{ endblock
> >
> > footer_javascript_section }}{{ block footer_javascript_page
> }}{{
> > endblock
> > footer_javascript_page }}
> > {{ endblock footer_javascript }}
> > {{ endblock footer }}
> > 
> >
> > --
> > → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> > → An Orthodox Christian author: theology, literature, et cetera.
> > → My award-winning collection is available for free reading online:
> > ☩ I invite you to visit my main site athttp://JonathansCorner.com/
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-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.

Re: I need django-evolution app

2010-04-27 Thread Shawn Milochik

On Apr 27, 2010, at 3:10 PM, Anand Agarwal wrote:

> How does it work if i want to run the schema changes for various database 
> instances?
> In my scenario each account has different database instance & there are 
> hundreds of them. I want to update schema changes in all the databases in one 
> go.
> 
> Regards
> Anand 

I don't know, but there is documentation here:  http://south.aeracode.org/docs/

-- 
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: Problems with first block

2010-04-27 Thread creecode
It is OK to include the name of the block in the endblock tag ( search
for 'For extra readability' in < 
http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance
>).  It is optional and I find it useful when working with longer
blocks.

Toodle-looo.
creecode

On Apr 27, 12:04 pm, x13  wrote:

> Notice you should not include 'dtd' in the endblock tag.

-- 
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: Problems with first block

2010-04-27 Thread x13

Did you read the tutorial? 
http://docs.djangoproject.com/en/1.1/topics/templates/#topics-templates

Seems to be a syntax problem

It's not

{{ block dtd }} ... {{ endblock dtd }}

the properly syntax (for last Django version) would be:

{% block dtd %} ... {% endblock %}

Notice you should not include 'dtd' in the endblock tag.

-f






On Apr 27, 3:51 pm, Jonathan Hayward
 wrote:
> I'm working on a base template. Django is giving a TemplateSyntaxError at my
> first attempted block declaration:
>
> TemplateSyntaxError at /
>
> Could not parse the remainder: ' dtd' from 'block dtd'
>
> Request Method:GETRequest URL:http://linux:/ExceptionType:
> TemplateSyntaxErrorException Value:
>
> Could not parse the remainder: ' dtd' from 'block dtd'
>
> Have I overgeneralized where blocks are appropriate, or is "dtd" something
> like a reserved word here?
>
> The template is:
>
> {{ block dtd }} "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>{{ endblock dtd }}
> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
>     {{ block head }}
>         {{ block title }}{{ page.title }}{{ endblock title }}
>         {{ block head_favicon }} type="x-icon" />
>          />{{ endblock head_favicon }}
>         {{ block head_meta }}
>             {{ block head_meta_author}}{{ endblock head_meta_author }}
>             {{ block head_meta_charset }} content="text/html; charset=UTF-8" />{{ endblock head_meta_charset }}
>             {{ block head_meta_contentlanguage }} http-equiv="Content-Language" value="en-US" />{{ endblock
> head_meta_contentlanguage }}
>             {{ block head_meta_description }}{{ endblock
> head_meta_description  }}
>             {{ block head_meta_keywords }}{{ endblock head_meta_keywords }}
>             {{ block head_meta_othertags }}{{ endblock head_meta_othertags}}
>
>             {{ block head_meta_refresh }}{{ endblock head_meta_refresh }}
>             {{ block head_meta_robots }}{{ endblock head_meta_robots }}
>         {{ endblock head_meta }}
>         {{ block head_rss }}{{ endblock head_rss }}
>         {{ block head_css }}
>             {{ block head_css_site }} href="/static/css/style.css" />{{endblock head_css_site }}
>             {{ block head_css_section }}{{ endblock head_css_section }}
>             {{ block head_css_page }}{{ endblock head_css_page }}
>         {{ endblock head_css }}
>         {{ block head_section }}{{ endblock head_section }}
>         {{ block head_page }}{{ endblock head_page }}
>     {{ endblock head }}
>     {{ block body }}
>         
>         {{ block body_sidebar }}{{ endblock body_sidebar }}
>         
>         
>         {{ block body_content }}
>             
>             {{ block body_header }}
>                 {{ block body_header_banner }}{{ endblock body_header_banner}}
>
>                 {{ block body_header_title }}{{ title }}{{ endblock
> body_header_title }}
>                 {{ block body_header_breadcrumb }}{{
> endblock body_header_breadcrumb }}
>             {{ endblock body_header }}
>             
>             {{ block body_announcements }}{{ endblock body_announcements }}
>             {{ block body_main }}{{ endblock body_main }}
>         {{ endblock body_content }}
>                         {{ block body_footer }}
>      {{ block body_footer_breadcrumb }}{{ page.breadcrumb }}{{ endblock
> body_header_breadcrumb }}
>             {{ block body_footer_legal }}{{ endblock body_footer_legal }}
>         {{ endblock body_footer }}
>             {{ endblock body }}    {{ block footer }}        {{
> block footer_javascript }}            {{ block 
> footer_javascript_site}} type="text/javascript"
>
> src="/static/js/jquery.js">{{ endblock
>  footer_javascript_site }}            {{ block footer_javascript_section}}{{ 
> endblock
>
> footer_javascript_section }}            {{ block footer_javascript_page }}{{
> endblock
> footer_javascript_page }}
>         {{ endblock footer_javascript }}
>     {{ endblock footer }}
> 
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site athttp://JonathansCorner.com/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.



Re: I need django-evolution app

2010-04-27 Thread Anand Agarwal
How does it work if i want to run the schema changes for various database
instances?
In my scenario each account has different database instance & there are
hundreds of them. I want to update schema changes in all the databases in
one go.

Regards
Anand
bootstraptoday 



On Tue, Apr 27, 2010 at 11:31 PM, Shawn Milochik  wrote:

> The newly-released South 0.70 does.
>
> 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 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-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.



usage of TIME_ZONE and zone-to-zone conversion

2010-04-27 Thread Shawn Milochik
Given a date/time value and a value that is valid for the TIME_ZONE setting in 
settings.py, how do I convert that date/time to the time zone defined in 
settings.py?

Example:
settings.py contains:
TIME_ZONE = 'America/New_York'

Input contains:
date/time value "13:00"
time_zone = "America/Los_Angeles"

Desired:
timedelta of the +/- difference needed to convert 13:00 PST to 
16:00 EST

It would be easy to create a dictionary of these values and their UTC offsets 
and just use that. But before I potentially reinvent a little wheel, I was 
wondering if this conversion was already being handled in Django. 

By looking at the Django codebase I've found the tzinfo file, but it expects to 
receive a timedelta as input, and doesn't actually use the TIME_ZONE value. 
Further grepping seems to indicate that the string values (such as 
'America/New_York') are only passed to the database engines when creating a 
connection object so that the database itself can handle the time zones, and 
expects the dates it receives to already have been converted to that zone.

It appears that the time and datetime Python libraries also use offsets and 
US-centric values such as PST and EST for time zones, and not the verbose names 
accepted by settings.py and PostgreSQL.

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



Re: Problems with first block

2010-04-27 Thread creecode
Hello Jonathan,

Use {% block dtd %} instead of {{ block dtd }}.

{{ }} are for accessing variables < 
http://docs.djangoproject.com/en/dev/topics/templates/#variables
>.

{% %} are for tags < http://docs.djangoproject.com/en/dev/topics/templates/#tags
>.

Toodle-loo...
creecode

On Apr 27, 11:51 am, Jonathan Hayward
 wrote:
> I'm working on a base template. Django is giving a TemplateSyntaxError at my
> first attempted block declaration:
>
> TemplateSyntaxError at /
>
> Could not parse the remainder: ' dtd' from 'block dtd'
>

> The template is:
>
> {{ block dtd }}

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



Problems with first block

2010-04-27 Thread Jonathan Hayward
I'm working on a base template. Django is giving a TemplateSyntaxError at my
first attempted block declaration:

TemplateSyntaxError at /

Could not parse the remainder: ' dtd' from 'block dtd'

Request Method:GETRequest URL:http://linux:/Exception Type:
TemplateSyntaxErrorException Value:

Could not parse the remainder: ' dtd' from 'block dtd'


Have I overgeneralized where blocks are appropriate, or is "dtd" something
like a reserved word here?

The template is:

{{ block dtd }}http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>{{ endblock dtd }}
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
{{ block head }}
{{ block title }}{{ page.title }}{{ endblock title }}
{{ block head_favicon }}
{{ endblock head_favicon }}
{{ block head_meta }}
{{ block head_meta_author}}{{ endblock head_meta_author }}
{{ block head_meta_charset }}{{ endblock head_meta_charset }}
{{ block head_meta_contentlanguage }}{{ endblock
head_meta_contentlanguage }}
{{ block head_meta_description }}{{ endblock
head_meta_description  }}
{{ block head_meta_keywords }}{{ endblock head_meta_keywords }}
{{ block head_meta_othertags }}{{ endblock head_meta_othertags
}}
{{ block head_meta_refresh }}{{ endblock head_meta_refresh }}
{{ block head_meta_robots }}{{ endblock head_meta_robots }}
{{ endblock head_meta }}
{{ block head_rss }}{{ endblock head_rss }}
{{ block head_css }}
{{ block head_css_site }}{{endblock head_css_site }}
{{ block head_css_section }}{{ endblock head_css_section }}
{{ block head_css_page }}{{ endblock head_css_page }}
{{ endblock head_css }}
{{ block head_section }}{{ endblock head_section }}
{{ block head_page }}{{ endblock head_page }}
{{ endblock head }}
{{ block body }}

{{ block body_sidebar }}{{ endblock body_sidebar }}


{{ block body_content }}

{{ block body_header }}
{{ block body_header_banner }}{{ endblock body_header_banner
}}
{{ block body_header_title }}{{ title }}{{ endblock
body_header_title }}
{{ block body_header_breadcrumb }}{{
endblock body_header_breadcrumb }}
{{ endblock body_header }}

{{ block body_announcements }}{{ endblock body_announcements }}
{{ block body_main }}{{ endblock body_main }}
{{ endblock body_content }}
{{ block body_footer }}
 {{ block body_footer_breadcrumb }}{{ page.breadcrumb }}{{ endblock
body_header_breadcrumb }}
{{ block body_footer_legal }}{{ endblock body_footer_legal }}
{{ endblock body_footer }}
{{ endblock body }}{{ block footer }}{{
block footer_javascript }}{{ block footer_javascript_site
}}{{ endblock
 footer_javascript_site }}{{ block footer_javascript_section
}}{{ endblock
footer_javascript_section }}{{ block footer_javascript_page }}{{
endblock
footer_javascript_page }}
{{ endblock footer_javascript }}
{{ endblock footer }}




-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

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

2010-04-27 Thread Shawn Milochik
The newly-released South 0.70 does.

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



Re: I need django-evolution app

2010-04-27 Thread Anand Agarwal
Hey Shwan,

Does south support multidb schema updates?

Regards
Anand
bootstraptoday 

On Fri, Mar 12, 2010 at 8:58 PM, Shawn Milochik  wrote:

> South has become the dominant DB migration tool for Django. Have a go at
> that.
>
> http://south.aeracode.org/
>
> 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 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-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.



Increase number of rows of a formset dynamically

2010-04-27 Thread Sonal Breed
Hello all,

I have a ModelFormSet defined as

RowFormSet = modelformset_factory(Row, extra=7)

The requirement is to give user capability to add more rows to the
displayed form so that now total number of rows in the formset
increases by 1.
Can we dynamically add more rows to the formset? If so, how can we
achieve it.

Thanks in advance,
Sincerely,
Sonal.

-- 
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: multi-language capabilities of Django/Satchmo

2010-04-27 Thread Andy McKay
> I'm interested in finding out more about practical use of django's
> multi-language capabilities for international sites.  Do any of you
> have experience with this?  And can you point towards resources/apps
> etc. for utilizing these features?

This is for i18n of the interface: 
http://docs.djangoproject.com/en/dev/topics/i18n/

For content this is a great talk from djangoski: 
http://docs.google.com/fileview?id=0B29qXMz8reouYzJhMjhhZDMtOTQ5MC00NjY3LWIxM2EtY2U3ZmI2NzQzYjk3&hl=en
--
  Andy McKay, @andymckay
  Django Consulting, Training and Support

-- 
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: multi-language capabilities of Django/Satchmo

2010-04-27 Thread Leo
I'm not sure exactly what your application needs are, but... we
implement our intranet apps on Django at a bilingual (English/
Japanese) company.  It's pretty much like the docs say it is...   The
hardest part may be setting up the gettext utilities if you don't
already have them.

Make sure the settings and middleware are right (they probably are by
default), mark your strings, create the files, do the translation,
compile the results -- pretty much as documented.  It's a little bit
of hand work to add your own language override settings if you need
them (we always want that - the browser preferences are a good default
but not always correct).

That's all for translating your web application, not for translating
the content. I don't know of automatic support for translated content
(a la multilingual Drupal) although there may be some packages out
there for it (django-cms certainly has stuff along those lines).  We
simply build it into our apps where needed.

Leo


On Apr 27, 4:37 am, django_jedi  wrote:
> Hi All,
>
> I'm interested in finding out more about practical use of django's
> multi-language capabilities for international sites.  Do any of you
> have experience with this?  And can you point towards resources/apps
> etc. for utilizing these features?
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.



Generic solution to Update Schema in multidb

2010-04-27 Thread Anand Agarwal
Hi Guys

We have a SaaS based application. We have developed the application on
Django 1.1. For each account we have a separate database. So its a multidb.
We make release every few weeks. Sometime there is some change in schema.
Currently we have customized django-evolution to update schema in all the
databases. Somehow this custom solution looks little fragile as the accounts
are growing at a fast rate.

So I am looking for some reliable solution to update schema in all the
databases. please let me know if there is already one.

Regards
Anand
www.bootstraptoday.com

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



Not translating the admin

2010-04-27 Thread filias
Hi,

I have a project with several applications and I am using i18n.
I would like to have everything translated except the admin. Is it
somehow possible to select which apps are subject to the i18n
middleware?

Thanks for your help.

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



Auth tests fail, remote_user

2010-04-27 Thread manu CAZ
Hi,

Tests of the  auth app are failing with my environnement, especially the
remote_user tests.
I didn't try to custom this app or anything. 'admin' , 'sites'  and
'contenttypes' are in my INSTALLED_APPS.

Did I missed a dependency ?

Here is a traceback:

ERROR: test_known_user
(django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 160, in test_known_user
super(RemoteUserCustomTest, self).test_known_user()
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 67, in test_known_user
self.assertEqual(response.context['user'].username, 'knownuser')
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_last_login
(django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 87, in test_last_login
self.assertNotEqual(default_login, response.context['user'].last_login)
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_no_remote_user
(django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 33, in test_no_remote_user
self.assert_(isinstance(response.context['user'], AnonymousUser))
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_unknown_user
(django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 168, in test_unknown_user
super(RemoteUserCustomTest, self).test_unknown_user()
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 51, in test_unknown_user
self.assertEqual(response.context['user'].username, 'newuser')
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_known_user
(django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 67, in test_known_user
self.assertEqual(response.context['user'].username, 'knownuser')
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_last_login
(django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 87, in test_last_login
self.assertNotEqual(default_login, response.context['user'].last_login)
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_no_remote_user
(django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 33, in test_no_remote_user
self.assert_(isinstance(response.context['user'], AnonymousUser))
  File "/usr/lib/python2.5/site-packages/django/template/context.py", line
44, in __getitem__
raise KeyError(key)
KeyError: 'user'

==
ERROR: test_unknown_user
(django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
--
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/django/contrib/auth/tests/remote_user.py",
line 118, in test_unknown_user

Re: statistics, reporting, charts for django

2010-04-27 Thread shacker

On Apr 27, 2:18 am, Georg Holzmann  wrote:
> Hallo!

>
> My question: is there a django application which I could reuse (or
> learn from) or which could help in the development ?
> It would be nice to have a dashboard to put charts, statistics, ...
> onto and an easy interface to generate those statistics out of django
> models.

There are a lot of data visualization libraries out there, some in
Flash, some in Javascript but probably the easiest to use are the
Google Chart APIs:

http://code.google.com/apis/charttools/

There is a Django wrapper for the Google Charts API that could make
your work easier:

http://code.google.com/p/google-chartwrapper/

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



E-commerce comparison: satchmo and lfs

2010-04-27 Thread Michel Thadeu Sabchuk
Hi guys,

I found 2 e-commerce applications available for django: Satchmo [1]
and LFS [2]. None of then is widely used in country (Brazil). I
planning to adapt them to the Brazilian reality, create payment
modules, etc.

I will try both before make a choice. Anyway, do you have any useful
note about them?

[1] http://www.satchmoproject.com/
[2] http://www.getlfs.com/

Thans in advance.

--
Michel Sabchuk
http://turbosys.com.br/

-- 
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: OS X install, not in home directory?

2010-04-27 Thread Bill Freeman
Rob,

See http://docs.python.org/install/index.html#alternate-installation

You may want the "home" scheme, but there's a lot of interesting
information there.  I don't know if you have to have created the
corresponding subdirectories (e.g.; ~/lib/python2.6/site-packages)
or not, nor whether the directory structure is different on the Mac.

Note that once you make things install there you will need to add
it's site-packages subdir to the python path.  The same documentation
describes your  options for this a bit further down.

Do not use sudo when installing to your home directory heirarchy,
you already have permissions there, and you probably want to
own the files that get installed.

Rather than here, you should try this question on a python list,
especially if you can find one focused on the Mac.  I also happen
to know that the moderator of the python tutor list uses (or used)
a Mac, and he's way smarter than me.

But really, the better way to do this kind of stuff is probably virtualenv.

Bill

On Tue, Apr 27, 2010 at 4:38 AM, Rob  wrote:
>
> Thanks, but none of those suggestions seem to work.  I'm not going to
> worry about this since I've got too many other things to do, (plus I'm
> in China and so to read a google group I have to use a proxy/tunnel),
> but for the record here's some more info...
>
> I think I'm using the system python...
>
> RobsMac-2 Django-1.1.1 $ which python
> /Library/Frameworks/Python.framework/Versions/2.6/bin/python
>
> --prefix is having no effect, but I'm not sure what to set it to given
> the OS X directories...
>
> RobsMac-2 Django-1.1.1 $ sudo python setup.py install --prefix=/
> Library/Frameworks/Python.framework/Versions/2.6
> running install
> ...
> Removing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
> py2.6.egg-info
> Writing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
> py2.6.egg-info
>
> So it put in my home dir.  Same with --prefix=/Library/Python/2.6.
>
> Using --install-base does produce this error...
>
> RobsMac-2 Django-1.1.1 $ sudo python setup.py install --install-base=/
> Library/Python/2.6
> running install
> error: install-base or install-platbase supplied, but installation
> scheme is incomplete
>
> PYTHONPATH is nothing.
>
>
> Rob
>
>
> On Apr 26, 11:22 pm, Bill Freeman  wrote:
>> Are you running setup using the system python, or a separate one tied
>> to your account (such as in a virtual env)?  If the latter then try 
>> specifying
>> the full path to the system python to run setup.  Also, if you have the
>> PYTHONPATH environment variable set, you might try unsetting it while
>> running the install.  (You can do this in a subshell and not affect other
>> operations.)
>>
>> Bill
>>
>>
>>
>> On Sat, Apr 24, 2010 at 9:36 AM, pjmorse  wrote:
>> > On Apr 24, 3:03 am, Rob  wrote:
>> >> Maybe this is more of a general python question, but when I run `sudo
>> >> python setup.py install` it insists on putting the django package in ~/
>> >> Library/Python/2.6/site-packages.  I want to install it in the system
>> >> site-packages, so it get's picked up by apache and mod_wsgi.  For now
>> >> I'll hand copy the files, but there must be a way with setup.py.  ?
>>
>> > Try the --prefix or --install-base options to `setup.py install`.
>> > `python setup.py install --help` will run down the options for you; I
>> > think --prefix=/Library/Python/2.6/site-packages/ is worth a shot?
>>
>> > pjm
>>
>> > --
>> > 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 
>> 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.
>
>

-- 
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: Django DatabaseError when using sqlall and syncdb

2010-04-27 Thread Fred Chevitarese
Hi!

As you said, you´ve created a new database, or you created a database and
restore a backup ?
Try to create a new and after this, run syncdb.


http://chevitarese.wordpress.com
Fred Chevitarese - GNU/Linux


2010/4/27 larsendt 

> I'm having issues creating a new database for my app. I'm using the
> Django 1.2 beta.
> I wrote the "people" app on another computer, and now I'm trying to
> get it working on a little server I have set up.
> When I try:
>
>./manage.py sqlall people
>
> I get the error:
>
>django.db.utils.DatabaseError: (1146, "Table
> 'peace_tracker_db.people_person' doesn't exist")
>
> I have already created the db in MySQL.
> The same thing happens when I use ./manage.py syncdb
>
> From what I've read elsewhere, there's a bug that has a similar effect
> when using multiple databases, but I am only using one database.
>
> Any suggestions?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>
>

-- 
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: reverse function results in NoReverseMatch when passing parameters

2010-04-27 Thread Frank
I think I've discoved that part of my issue is not understanding that
reverse(...) works in conjunction with the UrlConf file and not with
the views directly...

On Apr 27, 8:21 am, Frank  wrote:
> I suspect I have a simple problem here... But I'm a Django beginner
> (plus my Python could be stronger)
>
> I'm trying to use the reverse(...).
>
> When I call it as such:
>
>    return
> HttpResponseRedirect( reverse('my_site.core_prototype.views.PostWithList') )
>
> it works as expected.
>
> Now I need to call it with the intention of passing in a parameter. My
> method prototype looks like:
>
>     def PostWithList( request, numOfPosts=50, data=None, form =
> NewMicroPostForm() ):
>          #... etc... #
>
> How do I use reverse but passing in the form parameter? This is being
> called from another view where form validation has failed. I've
> attempted several variation all resulting in the same error...
>
> --
> 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.



Re: I want "DEBUG = False" but still get the DEBUG data logged

2010-04-27 Thread Tomasz Zieliński


On 27 Kwi, 14:52, Tomasz Chmielewski  wrote:
> Am 27.04.2010 14:08, Tom Evans wrote:
>
> > If DEBUG is False, it will email any errors to ADMINS - is this not 
> > sufficient?
>
> Technically, should be fine, thanks.
>
> But I just checked, and I'm not getting any emails.
>
>      ADMINS = (
>          ('Tomasz Chmielewski','@wpkg.org'),
>      )
>
> I.e. the MTA running on the same server does not log any new attempts,
> as I would get with "echo test | mail -s test someemail".
>
> Am I still missing some setting?
>

Maybe email settings are not valid: 
http://docs.djangoproject.com/en/1.1/ref/settings/#email-host
?

--
Tomasz Zielinski
http://pyconsultant.eu

-- 
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: Track "before" and "after" state of an object when editing in the Admin?

2010-04-27 Thread Tony Czeh
I had a very similar problem where I needed to track all changes to
models throughout the entire application.  I've posted my solution at
http://pastebin.com/2Wc4Nwcd for you to take a look at.

Basically, as was previously suggested, I've hooked into the various
pre_*, post_* and m2m_changed signals that are available.  My code
will log all changes to models unless the model is included in a
DONT_LOG_MODELS tuple in the app settings.  Changes to m2m
relationships are stored against the model containing the m2m.

Hope this helps.

Cheers,
Tony

-- 
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: While trying to set up Django on Windows: Attrib uteError: ‘Settings’ object has no attribute ‘DATABASE S’

2010-04-27 Thread Karen Tracey
On Tue, Apr 27, 2010 at 12:10 AM, cornflake  wrote:

> Thank you, the problem is solved!
> Turns out in the development version of Django some settings have been
> changed, so I had to declare DATABASES instead of DATABASE_ENGINE,
> DATABASE_HOST etc.
> http://docs.djangoproject.com/en/dev/ref/settings/
>

Note you should not have had to do this. The old format is still supported
under current trunk code; support for it will not be removed entirely for a
couple of releases yet. In fact the error you got was from the bit of code
that is attempting to figure out if it needs to fall back to pulling the
database settings from the old settings values.

The fact that you got this error would seem to indicate you are somehow
picking up an old level of the django/conf/global_settings.py file. Current
trunk level of this file has DATABASES set to an empty dictionary -- if you
were running with the current level of this file you would not have gotten
an attribute error attempting to access settings.DATABASES. I'd recommend
removing all old Django installations and re-installing to make sure you
have a consistent set of code -- what you are running right now appears to
be a mutant.

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



reverse function results in NoReverseMatch when passing parameters

2010-04-27 Thread Frank
I suspect I have a simple problem here... But I'm a Django beginner
(plus my Python could be stronger)

I'm trying to use the reverse(...).

When I call it as such:

   return
HttpResponseRedirect( reverse('my_site.core_prototype.views.PostWithList') )

it works as expected.

Now I need to call it with the intention of passing in a parameter. My
method prototype looks like:


def PostWithList( request, numOfPosts=50, data=None, form =
NewMicroPostForm() ):
 #... etc... #

How do I use reverse but passing in the form parameter? This is being
called from another view where form validation has failed. I've
attempted several variation all resulting in the same error...

-- 
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: I want "DEBUG = False" but still get the DEBUG data logged

2010-04-27 Thread Tomasz Chmielewski

Am 27.04.2010 14:08, Tom Evans wrote:

On Tue, Apr 27, 2010 at 12:21 PM, Tomasz Chmielewski  wrote:

Have cake and eat it it, too?


I have a website which will be more or less a production site soon - but I'd
like to still get all debugging information.


Leaving "DEBUG = True" is not an option, as it will potentially print
sensitive information in user's browser.

Setting "DEBUG = False" will disable debugging completely.


Is it possible to disable printing out debug information in user's browser,
but still have this debug info somewhere (i.e. to a log file only)?




If DEBUG is False, it will email any errors to ADMINS - is this not sufficient?


Technically, should be fine, thanks.

But I just checked, and I'm not getting any emails.

ADMINS = (
('Tomasz Chmielewski','t...@wpkg.org'),
)

I.e. the MTA running on the same server does not log any new attempts, 
as I would get with "echo test | mail -s test someemail".


Am I still missing some setting?


--
Tomasz Chmielewski
http://wpkg.org

--
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: Partial ModelForm produces empty var on ManyToMany relationship

2010-04-27 Thread Tom Evans
On Tue, Apr 27, 2010 at 9:50 AM, Florian Le Goff  wrote:
> Hi,
>
> I'm using Django's 1.1.1 official release and I'm trying to build a
> partial form, using ModelForm, with only one field, of the
> ManyToManyField type.
>
> If my partial form's Meta class "fields" attribute contains several
> attributes names, everything is working pretty smoothly. My form is
> produced, the template rendering is allright, and I'm able to fetch
> the values and save them using this partial form and request.POST .
>
> Unfortunately, if I try to set the field attribute of my partial form
> to only one attribute (the ManyToManyField previously mentioned), I'm
> getting an empty form.
>
> I'm calling my class this way :
>
>    item = get_object_or_404(ItemChild, pk=item_id,)
>    form_item_select = ItemPartialParent(instance=item)
>
> And here is my model :
>
> class ItemChild(models.Model):
>    name = models.CharField(max_length=120)
>
>    def __unicode__(self):
>        return self.name
>
> class ItemParent(models.Model):
>    name = models.CharField(max_length=120)
>    children = models.ManyToManyField(ItemChild)
>
> class ItemPartialParent(ModelForm):
>    class Meta:
>        model = ItemParent
> # working ok :
> #      fields = ('children' , 'name')
> # a call to ItemPartialParent() returns nothing :
>        fields = ('children')
>

You're missing a comma here:

Meta.fields is defined as an iterable.

iter( ('children') ) will return each char in 'children'

iter( ('children', ) ) will return 'children'

>>> for a in ('children'): print a
...
c
h
i
l
d
r
e
n
>>> for a in iter(('children',)): print a
...
children


Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: I want "DEBUG = False" but still get the DEBUG data logged

2010-04-27 Thread Tom Evans
On Tue, Apr 27, 2010 at 12:21 PM, Tomasz Chmielewski  wrote:
> Have cake and eat it it, too?
>
>
> I have a website which will be more or less a production site soon - but I'd
> like to still get all debugging information.
>
>
> Leaving "DEBUG = True" is not an option, as it will potentially print
> sensitive information in user's browser.
>
> Setting "DEBUG = False" will disable debugging completely.
>
>
> Is it possible to disable printing out debug information in user's browser,
> but still have this debug info somewhere (i.e. to a log file only)?
>
>

If DEBUG is False, it will email any errors to ADMINS - is this not sufficient?

Cheers

Tom

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



I want "DEBUG = False" but still get the DEBUG data logged

2010-04-27 Thread Tomasz Chmielewski

Have cake and eat it it, too?


I have a website which will be more or less a production site soon - but 
I'd like to still get all debugging information.



Leaving "DEBUG = True" is not an option, as it will potentially print 
sensitive information in user's browser.


Setting "DEBUG = False" will disable debugging completely.


Is it possible to disable printing out debug information in user's 
browser, but still have this debug info somewhere (i.e. to a log file only)?




--
Tomasz Chmielewski
http://wpkg.org

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



Partial ModelForm produces empty var on ManyToMany relationship

2010-04-27 Thread Florian Le Goff
Hi,

I'm using Django's 1.1.1 official release and I'm trying to build a
partial form, using ModelForm, with only one field, of the
ManyToManyField type.

If my partial form's Meta class "fields" attribute contains several
attributes names, everything is working pretty smoothly. My form is
produced, the template rendering is allright, and I'm able to fetch
the values and save them using this partial form and request.POST .

Unfortunately, if I try to set the field attribute of my partial form
to only one attribute (the ManyToManyField previously mentioned), I'm
getting an empty form.

I'm calling my class this way :

item = get_object_or_404(ItemChild, pk=item_id,)
form_item_select = ItemPartialParent(instance=item)

And here is my model :

class ItemChild(models.Model):
name = models.CharField(max_length=120)

def __unicode__(self):
return self.name

class ItemParent(models.Model):
name = models.CharField(max_length=120)
children = models.ManyToManyField(ItemChild)

class ItemPartialParent(ModelForm):
class Meta:
model = ItemParent
# working ok :
#  fields = ('children' , 'name')
# a call to ItemPartialParent() returns nothing :
fields = ('children')

I am doing something wrong ?

Did anyone run into this already ?

Thank you,
Florian.

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



odering User in a form

2010-04-27 Thread Alfredo Alessandrini
Hi,

I've this model:

class Pubblicazioni(models.Model):
anno = models.DateField(blank=True, null=True,default=datetime.date.today)
autori = models.CharField(max_length=500)
titolo = models.CharField(max_length=500)
autori_daf = models.ManyToManyField(User)

I need to ordering  (by the User.last_name) the field 'autori_daf'
when it is displayed at the form generated by

class PubblicazioniForm(ModelForm):
class Meta:
model = Pubblicazioni



Thanks,

Alfredo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Redirect to named url pattern not working

2010-04-27 Thread Tom Evans
On Mon, Apr 26, 2010 at 10:16 PM, Daniel Klein  wrote:
> Hi,
>
> I'm trying to avoid hardcoding a URL in a redirect call, but I can't
> for the life of me make redirect work. The relevant code segments
> first:
>
> From urls.py:
>
>        url(r'^game/(\d+)/$', 'views.game', name='gameview'),

^^^ This is a positional argument

>
> From the view:
>
>                        return redirect("gameview", id = newgame.id)

^^^ This is a named argument

>
>
> The error I get is:
>
> NoReverseMatch at /prelobby/
> Reverse for 'gameview' with arguments '()' and keyword arguments
> '{'id': 24}' not found.

 This is it explaining that to you :)

Either change the URL to use a named argument as Javier suggested, or
use positional arguments, eg:

  reverse('some_name', args=[arg1,arg2])

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Template tag to understand if a request if from a spider

2010-04-27 Thread Daniel Roseman
On Apr 27, 9:42 am, Alessandro Ronchi 
wrote:
> Is it possible to check in a django template if a request is from a spider/
> bot or not?
>
> --
> Alessandro Ronchi
>

As long as you use a RequestContext to render your template, and the
tag itself has access to the `request` object - either passed
explicitly, or by using `takes_context=True` in an inclusion tag, then
you can check the value of `request.META['HTTP_USER_AGENT']` to see
what made the request.

There's a list of robot user agent strings here:
http://www.robotstxt.org/db.html
--
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-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.



statistics, reporting, charts for django

2010-04-27 Thread Georg Holzmann
Hallo!

I want to build an application like google analytics for django ;) :
users should be able to log in and see their statistics/charts.
So basically it should be somehow like the django-reporting
application, but not in the admin section (should be for general
users), with additional (Javascript-based?) charts and maybe also a
possibility to print out reports (e.g. with reportlab).

My question: is there a django application which I could reuse (or
learn from) or which could help in the development ?
It would be nice to have a dashboard to put charts, statistics, ...
onto and an easy interface to generate those statistics out of django
models.

Thanks for any hints,
LG
Georg

-- 
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: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-27 Thread Kevin Renskers
Works like a charm, thanks!

> The issue with the custom field is that it does not implement a
> 'validate' func
>
> I believe all I did to get it working was add:
>
>     def validate(self, value, model_instance):
>         return

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



Template tag to understand if a request if from a spider

2010-04-27 Thread Alessandro Ronchi
Is it possible to check in a django template if a request is from a spider/
bot or not?


-- 
Alessandro Ronchi

http://www.soasi.com
SOASI - Sviluppo Software e Sistemi Open Source

Hobby & Giochi, l'e-commerce del divertimento
http://hobbygiochi.com
http://www.facebook.com/pages/Forli/Hobby-Giochi/185311523755

-- 
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: OS X install, not in home directory?

2010-04-27 Thread Rob

Thanks, but none of those suggestions seem to work.  I'm not going to
worry about this since I've got too many other things to do, (plus I'm
in China and so to read a google group I have to use a proxy/tunnel),
but for the record here's some more info...

I think I'm using the system python...

RobsMac-2 Django-1.1.1 $ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python

--prefix is having no effect, but I'm not sure what to set it to given
the OS X directories...

RobsMac-2 Django-1.1.1 $ sudo python setup.py install --prefix=/
Library/Frameworks/Python.framework/Versions/2.6
running install
...
Removing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
py2.6.egg-info
Writing /Users/rob/Library/Python/2.6/site-packages/Django-1.1.1-
py2.6.egg-info

So it put in my home dir.  Same with --prefix=/Library/Python/2.6.

Using --install-base does produce this error...

RobsMac-2 Django-1.1.1 $ sudo python setup.py install --install-base=/
Library/Python/2.6
running install
error: install-base or install-platbase supplied, but installation
scheme is incomplete

PYTHONPATH is nothing.


Rob


On Apr 26, 11:22 pm, Bill Freeman  wrote:
> Are you running setup using the system python, or a separate one tied
> to your account (such as in a virtual env)?  If the latter then try specifying
> the full path to the system python to run setup.  Also, if you have the
> PYTHONPATH environment variable set, you might try unsetting it while
> running the install.  (You can do this in a subshell and not affect other
> operations.)
>
> Bill
>
>
>
> On Sat, Apr 24, 2010 at 9:36 AM, pjmorse  wrote:
> > On Apr 24, 3:03 am, Rob  wrote:
> >> Maybe this is more of a general python question, but when I run `sudo
> >> python setup.py install` it insists on putting the django package in ~/
> >> Library/Python/2.6/site-packages.  I want to install it in the system
> >> site-packages, so it get's picked up by apache and mod_wsgi.  For now
> >> I'll hand copy the files, but there must be a way with setup.py.  ?
>
> > Try the --prefix or --install-base options to `setup.py install`.
> > `python setup.py install --help` will run down the options for you; I
> > think --prefix=/Library/Python/2.6/site-packages/ is worth a shot?
>
> > pjm
>
> > --
> > 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 
> 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.