Re: Form with manytomany field

2011-05-03 Thread Daniel Roseman
On Tuesday, 3 May 2011 02:37:56 UTC+1, daniel.franca wrote:
>
> anyone?
> Maybe what I need is something like OneToMany relationship, i guess, but 
> there's no such thing in django
>
> Er, what? What about ForeignKey?

Anyway, what you need is inline model formsets:
http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#inline-formsets
--
DR.

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



Re: Overwriting the handler404

2011-05-03 Thread doniyor
hey, yes, sure, i import all the necessities.

but the default handler404 seems to be called all the time. i cannot
control it somehow.



On May 2, 6:11 pm, Jason Culverhouse  wrote:
> On May 1, 2011, at 8:01 AM, doniyor wrote:
>
>
>
>
>
>
>
>
>
> > Hi there,
> > i am trying to overwrite handler404 of django so that i can call my
> > own view function when it doesnot find the appropriate view and if it
> > tries to give Http404. the whole problem is as follows:
>
> > i defined my view function called 'remap_test' in my proxy app. and i
> > changed the default handler404 to handler404 =
> > 'proxy.views.remap_test'.
> > The problem is that it gives all the time 404 error even if the
> > handler404 is defined right and even if it is in right place(in
> > urls.py) and the settings.py has the DEBUG = FALSE and my new view
> > function is theoretically ready to be called. but it isnot called,
> > sometimes it is. it is sooo weird.
>
> > i will post here the code blocks i added:
>
> > in my urls.py is this:
> > 
>
> You problem statement is a little confusing, so I'm not sure I am on the 
> right track here
>
> Just a quick thought,
> Does your urls.py contain
> from django.conf.urls.defaults import *
>
> If you are missing the "import *" the handler404 function that your are 
> assigning to
>
> > handler404 = 'proxy.views.remap_test'
> > .
>
> will just be a local variable and not django.conf.urls.defaults.handler404
>
> Jason
>
>
>
>
>
>
>
> > 
>
> > and my view function is this:
>
> > def remap_test(request):
> >   return HttpResponse("test message as 404")
>
> > and my model is this:
>
> > class Remap(models.Model):
> >    new_url = models.CharField(max_length=50)
> >    src_url = models.CharField(max_length=150)
> >    def __unicode__(self):
> >        return self.src_url
>
> > ... i dont know why it calls 404 all the time, sometimes i get the
> > problem if i add items to my database tables in admin, and sometimes
> > not. can someone please help me with this or does anyone have an idea
> > what the problem could be ?
>
> > thank you guys so much in advance,
>
> > doni
>
> > --
> > 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 
> > 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-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.



What is Module and where to use them wisely

2011-05-03 Thread doniyor
Hey guys,

i have got a simple but sometimes confusing issue:

what is module and can i use it both in global urls.py  and in local
urls.py ? i wonder, which one is a wise way ?

thanks much,

doni

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



Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hello,

Being new to Django, I was told by a friend that it only supports i18n for a 
limited set of languages - these being only languages that have had Django 
itself translated to. 

Is this true? Doesn't make much sense to me :) Is there a definitive list of 
languages supported by Django's i18n features?


Thanks,
urig

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



CSS linking error

2011-05-03 Thread Pascal Moutia
Hi there Django-users

I'm suppose to link CSS to my base.html but i can't get it worked :s there is 
my url line:


if settings.DEBUG:
urlpatterns += patterns('',
url(r'^static/(?P.*)$', 'django.views.static.serve', 
{'document_root': settings.PROJECT_PATH+'/static/', 'show_indexes': True}),
)


and my html link with the MEDIA_URL setting:

link rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_ROOT 
}}static/css/style.css" />

import os.path
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))

MEDIA_ROOT = os.path.join(PROJECT_PATH, '/static/')


How can is get it work ?

thx for your help ! :D

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



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Lachlan Musicman
On Tue, May 3, 2011 at 19:19, Uri Goldstein  wrote:
> Hello,
>
> Being new to Django, I was told by a friend that it only supports i18n for a
> limited set of languages - these being only languages that have had Django
> itself translated to.
>
> Is this true? Doesn't make much sense to me :) Is there a definitive list of
> languages supported by Django's i18n features?

Strictly, since i18n is language neutral, no there isn't.

It's not that you can't translate Django into other languages or try
to use it in other languages, but if the translations aren't
there...well, we can't support them and when you build a site, most of
it will be in the default language (usually English).

The list of language into which Django has been translated can be
found in the source code here (note: this is trunk):

http://code.djangoproject.com/browser/django/trunk/django/conf/locale

Note that if you would like to translate Django into another language,
there are only about 300 strings and they are mostly easy (ie, months,
days, numbers etc)

The translation is managed through Transifex, which you can join for free.

Here is the translation project page:

http://www.transifex.net/projects/p/django/

cheers
L.



>
>
> Thanks,
> urig
>
> --
> 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.
>



-- 
Benford’s law, also called the first-digit law, states that in lists
of numbers from many (but not all) real-life sources of data, the
leading digit is distributed in a specific, non-uniform way. According
to this law, the first digit is 1 almost one third of the time, and
larger digits occur as the leading digit with lower and lower
frequency, to the point where 9 as a first digit occurs less than one
time in twenty. (via @cyberu)
from The Best of Wikipedia http://bestofwikipedia.tumblr.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.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 02:19 -0700, Uri Goldstein wrote:
> Being new to Django, I was told by a friend that it only supports i18n
> for a 
> limited set of languages - these being only languages that have had
> Django 
> itself translated to. 
> 
> Is this true? Doesn't make much sense to me :) 

it is true. Why does it not make sense to you?

django has only those languages where people have come forward to do the
translation - but I would not call it a 'limited set'. There are a
helluva lot.

> Is there a definitive list of 
> languages supported by Django's i18n features?
> 
> 

yes look in the source code under django/conf/locale
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Thank you for your quick response. 

I now realize that my friend was referring to "the strings commonly 
displayed by Django". Naturally these are yet to have been translated to all 
available languages but I'm sure we'll get there sme day :).

I'm fine in knowing that the i18n infrastructure in Django can handle any 
available language - that was the crux of my question.


Thanks again!
urig

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



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 11:59 AM, Uri Goldstein  wrote:
> Thank you for your quick response.
>
> I now realize that my friend was referring to "the strings commonly
> displayed by Django". Naturally these are yet to have been translated to all
> available languages but I'm sure we'll get there sme day :).
>
> I'm fine in knowing that the i18n infrastructure in Django can handle any
> available language - that was the crux of my question.
>

If you wish to have a language available that is not in Django's set
of base translations, so that you can add your own translations for
that language for your parts of the site, then you have to go through
some additional hoops to allow this. This is probably what your friend
was referring to.

http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: What is Module and where to use them wisely

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 10:17 AM, doniyor  wrote:
> Hey guys,
>
> i have got a simple but sometimes confusing issue:
>
> what is module and can i use it both in global urls.py  and in local
> urls.py ? i wonder, which one is a wise way ?
>
> thanks much,
>
> doni
>

Your question makes no sense. A module is a python file - eg urls.py
is a python module named 'urls'.

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 03:59 -0700, Uri Goldstein wrote:
> I'm fine in knowing that the i18n infrastructure in Django can handle
> any 
> available language - that was the crux of my question. 

to be precise, there are two parts in localisation - one is the strings
in django itself and the other is the strings that you create as part of
your app which you have to translate yourself. But if django itself does
not have the language, your local strings will also not be translated.
There are two ways of getting around this:

1. actually do the translation and get the language into django
or
2. Create the directory structure for the new language in the django
source code in your local version and add untranslated .po and .mo
files. The second approach is a hack in that your strings will get
translated but django strings will not.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

2011-05-03 Thread Tom Evans
On Sat, Apr 30, 2011 at 11:16 AM, jsierra  wrote:
> I figured it out, i chmod -R 775 the django directory located in
> /usr/local/lib/python2.7/dist-packages and was able to use the commands
> without sudo. Whether or not that's a good idea, I don't know, but it's my
> personal laptop anyway. Thanks for tying to help Shawn. Much appreciated.
>
> Regards,
> Joshua Sierra
>

It's not a good idea, it's an incredibly bad idea. You do not have to
use sudo to run django-admin commands, if you do you are doing
something wrong. Users should not need to or be able to write into
/usr/local/lib/. I suspect you are doing something incorrectly.

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



escaping (where is the exit)

2011-05-03 Thread MikeKJ

I got data from the database in a page, I then merge it as string
substitution though another template and end up with double escaping because
the escaping is automatic, the only place I can try to de escape is the
2ndary template, I have tried
 {% autoescape on %}{{ content }}{% endautoescape %} 
 {% autoescape off %}{{ content }}{% endautoescape %}
 {{ content|escape }}
 {{ content|force_escape }}
 even tried
 {{ content|safe }}

any ideas please?
-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31531487.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Thank you Tom and KG. 

I now see that my friend was right(!).  
http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files
 
says: "Django does not support localizing your application into a locale for 
which Django itself has not been translated."

The motivation for this is explained there but I personally find this 
disappointing. In my case I only care about my strings and I don't mind 
mixing the translated language with English.

KG, in the workaround you mention as my second option, are you referring to 
the folder /conf/locale ? Is there where I will be putting my "new" 
languages?

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



Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread Karen Tracey
You need to set up the environment/locale for your server so that Python
will allow non-ascii characters in filenames. See:
http://docs.djangoproject.com/en/1.3/howto/deployment/modpython/#if-you-get-a-unicodeencodeerror

Karen
-- 
http://tracey.org/kmt/

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



Re: escaping (where is the exit)

2011-05-03 Thread Michael Radziej
On Tue, 3 May 2011 04:25:46 -0700 (PDT), MikeKJ  wrote:
> 
> I got data from the database in a page, I then merge it as string
> substitution though another template and end up with double escaping because
> the escaping is automatic, the only place I can try to de escape is
> the

Can you show us the code that builds {{ content }}, please? Probably the
escaping has already happened there.


Kind regards

Michael

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



ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Thomas Weholt
Inserting, updating or deleting lots of records using the Django ORM?
Want better performance? Check out DSE!

It's free, released under the GPL licence. More information about the
possible performance gain can be seen here:
http://weholt.blogspot.com/2011/05/dse-uses-18-of-time-compared-to-django.html

DSE at pypi:
http://pypi.python.org/pypi/dse/

Source at bitbucket.org:
https://bitbucket.org/weholt/dse2

Thanks for your attention.

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Brian Bouterse
This would have been so useful on my last project.  14.4 Million records
took a couple of days with a single thread using the ORM.  This would have
really sped things up.

Brian

On Tue, May 3, 2011 at 7:50 AM, Thomas Weholt wrote:

> Inserting, updating or deleting lots of records using the Django ORM?
> Want better performance? Check out DSE!
>
> It's free, released under the GPL licence. More information about the
> possible performance gain can be seen here:
>
> http://weholt.blogspot.com/2011/05/dse-uses-18-of-time-compared-to-django.html
>
> DSE at pypi:
> http://pypi.python.org/pypi/dse/
>
> Source at bitbucket.org:
> https://bitbucket.org/weholt/dse2
>
> Thanks for your attention.
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.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-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.
>
>


-- 
Brian Bouterse
ITng Services

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



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 04:39 -0700, Uri Goldstein wrote:
> KG, in the workaround you mention as my second option, are you
> referring to 
> the folder /conf/locale ? Is there where I will be putting my "new" 
> languages? 

yes - for example if the language you are adding is martian (with
abbreviation of mrt), then you create a directory like this:
conf/locale/mrt/LC_MESSAGES/

copy the default .po files to it, run compilemessages and you will get
the appropriatie .mo files (or you can just copy the .mo files from the
en/LC_MESSAGES/ directory). 

in your project/locale you will actually have to translate the strings
to martian if you need it.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Thomas Weholt
Hehe ... yes, that's exactly the kind of things DSE is good at. 1.8%
of two days ... that's half an hour?? Mind you, I've so far not
inserted that many records, so if you ever get the chance to try that
out please let me know how it goes.

Thomas

On Tue, May 3, 2011 at 1:55 PM, Brian Bouterse  wrote:
> This would have been so useful on my last project.  14.4 Million records
> took a couple of days with a single thread using the ORM.  This would have
> really sped things up.
> Brian
>
> On Tue, May 3, 2011 at 7:50 AM, Thomas Weholt 
> wrote:
>>
>> Inserting, updating or deleting lots of records using the Django ORM?
>> Want better performance? Check out DSE!
>>
>> It's free, released under the GPL licence. More information about the
>> possible performance gain can be seen here:
>>
>> http://weholt.blogspot.com/2011/05/dse-uses-18-of-time-compared-to-django.html
>>
>> DSE at pypi:
>> http://pypi.python.org/pypi/dse/
>>
>> Source at bitbucket.org:
>> https://bitbucket.org/weholt/dse2
>>
>> Thanks for your attention.
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.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-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.
>>
>
>
>
> --
> Brian Bouterse
> ITng Services
>
> --
> 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.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 12:39 PM, Uri Goldstein  wrote:
> Thank you Tom and KG.
>
> I now see that my friend was right(!).
> http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files
> says: "Django does not support localizing your application into a locale for
> which Django itself has not been translated."
>
> The motivation for this is explained there but I personally find this
> disappointing. In my case I only care about my strings and I don't mind
> mixing the translated language with English.
>

The 'motivation' is a technical limitation, and you omitted to quote
the part explaining how you can add translations for languages that
Django itself does not have a translation for, a process which takes
but a few seconds.

Having docs is good, reading and comprehending the docs is better. You
are looking for issues where there are none. If you require your site
to be in Mongolian, it can be in Mongolian, even though Django does
not itself have a Mongolian translation, it just requires a minuscule
amount of effort on your part - as it would in any gettext based
translation system.

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



Fwd: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Cal Leeming [Simplicity Media Ltd]
Amazingly, I'm actually due to run a clean up script on a database with 32
million rows in the next couple of days...

Could you possibly answer:

   - How mature is the code?

   - Have you encountered any strange problems whilst using it?

   - How many other people have used this in production (that you know of)
   on a large data set?

   - Have you tested against SQL injection?

   - What performance benefits does this have, over using .raw() or
   .update() ?? Can you provide some benchmarks over 50 thousand rows?

Cheers

Cal

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



Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ


In this instance the else is active as there is no incoming context


def get_pretty_smartpage_for_email(slug, context=None,
surrounding_template='email/pretty.html'):
"""
Renders a smartpage using the 'pretty' email template
returns the rendered content, with any passed-in context rendered in
"""

try:
s = SmartPage.objects.get(slug=slug)
except SmartPage.DoesNotExist:
s = SmartPage(content='Error: Missing template: %s' % slug,
name='Missing template')

if context:
# Render any passed-in context into the smartpage
sptemplate = loader.get_template_from_string(s.content)
spcontent = sptemplate.render(context)
else:
spcontent = s.content
if slug == 'email-policy-summary' or 'fleet-email-policy-summary':
spcontent = '
http://lime.paston.co.uk/media/images/Keyfacts_logo_.jpg ' + spcontent

context = Context({
'content' : spcontent,
'title' : s.name,
})

t = loader.get_template(surrounding_template)
content = t.render(context)

-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31531945.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hi Tom,

I definitely agree that having docs is good, reading and comprehending the 
docs is better. Reading and comprehending the docs yourself you might have 
noticed the following quote: "If you were to try this and Django supported 
it, you would inevitably see a mixture of translated strings (from your 
application) and English strings (from Django itself)." No mention of a 
technical limitation, only of a goal to not see the mixture of translated 
strings. 

The amount of effort to "to make at least a minimal translation of the 
Django core" might be minuscule or it might not, I find that it shouldn't be 
made necessary.

And finally, I am assured that this is but a small issue to deal with and 
yet, had it not been an issue in the first place it would not have been 
mentioned in the official docs, would it?


Cheers

Uri

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



Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ

In this instance the else is active as there is no incoming context


def get_pretty_smartpage_for_email(slug, context=None,
surrounding_template='email/pretty.html'):
"""
Renders a smartpage using the 'pretty' email template
returns the rendered content, with any passed-in context rendered in
"""

try:
s = SmartPage.objects.get(slug=slug)
except SmartPage.DoesNotExist:
s = SmartPage(content='Error: Missing template: %s' % slug,
name='Missing template')

if context:
# Render any passed-in context into the smartpage
sptemplate = loader.get_template_from_string(s.content)
spcontent = sptemplate.render(context)
else:
spcontent = s.content
if slug == 'email-policy-summary' or 'fleet-email-policy-summary':
spcontent = 'header image' + spcontent

context = Context({
'content' : spcontent,
'title' : s.name,
})

t = loader.get_template(surrounding_template)
content = t.render(context) 
-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31532577.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 1:43 PM, Uri Goldstein  wrote:
> Hi Tom,
>
> I definitely agree that having docs is good, reading and comprehending the
> docs is better. Reading and comprehending the docs yourself you might have
> noticed the following quote: "If you were to try this and Django supported
> it, you would inevitably see a mixture of translated strings (from your
> application) and English strings (from Django itself)." No mention of a
> technical limitation, only of a goal to not see the mixture of translated
> strings.

Were you expecting that a new translation would automatically have the correct
translations for that language? What a strange expectation.

The technical limitation belongs to gettext, not Django. It cannot load a
supplementary language file when the main language file doesn't exist.
IE, for our putative Mongolian translation, it cannot load
your_app/locale/mn/LC_MESSAGES/django.mo if
django/locale/mn/LC_MESSAGES/django.mo does not exist.


>
> The amount of effort to "to make at least a minimal translation of the
> Django core" might be minuscule or it might not, I find that it shouldn't be
> made necessary.

You think Django should support all languages, out of the box? Do you
have a patch?

FYI, 'a minimal translation of the Django core' means copying the 'en'
translation to your new language. Whether you need to translate parts
of that depends upon whether your site needs it.

>
> And finally, I am assured that this is but a small issue to deal with and
> yet, had it not been an issue in the first place it would not have been
> mentioned in the official docs, would it?
>

Many things are mentioned in the manual that are small issues, since they
evidently confuse new users. This is one of them. Anyone who has used gettext
before would be aware of this issue, and it is extensively detailed in the
gettext manual.

Django's docs could easily have just said "Django uses gettext to deliver
translatable content, refer to the gettext manual for implementation details",
but it does more to help out new users.


Bottom line: Django supports adding translations for as many languages
as you like, but cannot and will not magically have translations for
any languages which it does not support. You, as the website
developer, are free to add languages that Django does not support, and
doing so is a few trivial steps.

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: escaping (where is the exit)

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 1:29 PM, MikeKJ  wrote:
>
>
> In this instance the else is active as there is no incoming context
>
>
> def get_pretty_smartpage_for_email(slug, context=None,
> surrounding_template='email/pretty.html'):
>    """
>    Renders a smartpage using the 'pretty' email template
>    returns the rendered content, with any passed-in context rendered in
>    """
>
>    try:
>        s = SmartPage.objects.get(slug=slug)
>    except SmartPage.DoesNotExist:
>        s = SmartPage(content='Error: Missing template: %s' % slug,
> name='Missing template')
>
>    if context:
>        # Render any passed-in context into the smartpage
>        sptemplate = loader.get_template_from_string(s.content)
>        spcontent = sptemplate.render(context)
>    else:
>        spcontent = s.content
>        if slug == 'email-policy-summary' or 'fleet-email-policy-summary':
>                spcontent = '
> http://lime.paston.co.uk/media/images/Keyfacts_logo_.jpg ' + spcontent
>
>    context = Context({
>        'content' : spcontent,
>        'title' : s.name,
>    })
>
>    t = loader.get_template(surrounding_template)
>    content = t.render(context)
>

spcontent is HTML?

from django.utils.safestring import mark_safe
    context = Context({
        'content' : mark_safe(spcontent),
        'title' : s.name,
    })

http://docs.djangoproject.com/en/1.3/ref/utils/#django.utils.safestring.mark_safe
http://docs.djangoproject.com/en/1.3/howto/custom-template-tags/#filters-and-auto-escaping

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



datailview

2011-05-03 Thread Yasmany Cubela Medina
hi im very new in django so i try to use generic views like say in the doc and 
dont work for me

this is my code

class DownloadDetailView( DetailView ):
model = Download.objects.all()
context_object_name = "download_list"
template_name = "download.html"

def get_context_data( self, **kwargs ):
# Call the base implementation first to get a context
context = super( DownloadDetailView, self ).get_context_data( 
**kwargs )
# Add in a QuerySet of all the books
context['category_list'] = Category.objects.all()
return context

in the template the data for download_list is available and ok but the other 
list category_list even exist, what is the problem here, its just like the 
example in the doc.



El ayer es un recuerdo, el mañana es un misterio y el ahora es un regalo...por 
eso se llama presente.

Ing. Yasmany Cubela Medina:
Linux user 446757
Ubuntu user 13464

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



Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ

I tried that too after the original post and that made no difference
spcontent is escaped HTML
and I thought that by marking it safe it wouldnt be escaped again in the 
pretty.html template

Thx
Mike

spcontent is HTML?

from django.utils.safestring import mark_safe
    context = Context({
        'content' : mark_safe(spcontent),
        'title' : s.name,
    })

http://docs.djangoproject.com/en/1.3/ref/utils/#django.utils.safestring.mark_safe
http://docs.djangoproject.com/en/1.3/howto/custom-template-tags/#filters-and-auto-escaping

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




-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31532857.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread Ariel
In my apache enviroment settings I have already set that:

export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'

But I still get the same error. Bedsides I am using wsgi no modpython.

Please, could somebody help me ???
Regards
Thanks in advance.
Ariel


On Tue, May 3, 2011 at 1:40 PM, Karen Tracey  wrote:

> You need to set up the environment/locale for your server so that Python
> will allow non-ascii characters in filenames. See:
> http://docs.djangoproject.com/en/1.3/howto/deployment/modpython/#if-you-get-a-unicodeencodeerror
>
> Karen
> --
> http://tracey.org/kmt/
>
>  --
> 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.



Re: escaping (where is the exit)

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 3:18 PM, MikeKJ  wrote:
>
> I tried that too after the original post and that made no difference
> spcontent is escaped HTML
> and I thought that by marking it safe it wouldnt be escaped again in the
> pretty.html template
>
> Thx
> Mike
>

If spcontent is escaped HTML (eg '
' rather than ''), nothing will automatically unescape it for you, you will need to do that yourself. 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-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Jirka Vejrazka
Thanks for DSE!

  I tried it earlier (version 0.6 I think). While I really liked the
speed improvement, there were 2 areas that did not suit me too well:

  - error detection - I needed reliability more than speed and I was
not comfortable with situations like "the IntegrityErrror is somewhere
in last 1000 inserts"

 - multi-db support. I rely heavily on that and DSE was not mature
enough there (I opened a ticket or two). I have not checked since if
there's been any improvement.

  So, I'm not using DSE today but putting my 2 complaints aside, I
really liked it when I tested it.

  Cheers

Jirka

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



Re: escaping (where is the exit)

2011-05-03 Thread Michael Radziej
On Tue, 3 May 2011 07:18:24 -0700 (PDT), MikeKJ  wrote:
> 
> I tried that too after the original post and that made no difference
> spcontent is escaped HTML and I thought that by marking it safe it
> wouldnt be escaped again in the pretty.html template

That's correct. But is spcontent escaped once or already twice at that
point?

Kind regards

Michael

-- 

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



Do any financial firms use a Django framework?

2011-05-03 Thread rpt...@reportlab.com
Does anyone know of any financial firms which use a Django framework?
I am preparing a proposal to build a web based solution for a
financial firm using Django, and some key players there would be much
more comfortable if I could point to some "serious" firms in finance
or similar industries which use Django.

I have googled around and found some links such as:

 - http://www.djangosites.org/

 - http://bostinnovation.com/2011/03/31/boston-companies-using-django/

But a lot of these examples are from news and social networking
sites.

If anyone can give examples of Django being used by financial firms or
blue-chip companies, it would be very appreciated.

Thanks,

Tom

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



Re: 500 message with POST

2011-05-03 Thread BobX
On May 2, 4:14 pm, А. Р. <4d876...@gmail.com> wrote:
> > @csrf_exempt
> > Any ideas what I'm doing wrong?
>
> Try importing csrf_exempt at the top of your views.py:
> from django.views.decorators.csrf import csrf_exempt
Yes, I already did that - just omitted the declaration from the
message to save space. Oops.

On May 2, 5:14 pm, Ian Clelland  wrote:
> On Mon, May 2, 2011 at 7:45 AM, Robert Cross  wrote:

> The fact that, on GET, you are getting a 301 first means that the URL that
> you are providing is not the correct one for the resource. You probably have
> "/posttest/" defined in your urls.py, but you are using wget to access
> "/posttest" (no trailing slash). On a GET request, it is perfectly safe to
> just issue a redirect to the correct URL, but it is not necessarily safe for
> POST requests. I believe that Django will issue the redirect anyway, buy the
> user agent is *not* supposed to just blindly post the data to the new URL
> without some sort of user interaction.
>
> To eliminate this as a possible error source, try putting the trailing "/"
> on the URL in the command line:
>
> $ wget --post-data 
> 'data=Something'http://localhost:8000/posttest/?data=CommandLine
>
> Then you should get { 'data': 'CommandLine' } in request.GET, and { 'data':
> 'Something' } in request.POST.
Darn it - you were exactly right. Added the trailing slash, and the
code (the test one I gave and the real code) is now working
flawlessly. Thanks for the pointer and the explanation. :)

Bob

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



Re: escaping (where is the exit)

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 3:49 PM, Michael Radziej  wrote:
> On Tue, 3 May 2011 07:18:24 -0700 (PDT), MikeKJ  
> wrote:
>>
>> I tried that too after the original post and that made no difference
>> spcontent is escaped HTML and I thought that by marking it safe it
>> wouldnt be escaped again in the pretty.html template
>
> That's correct. But is spcontent escaped once or already twice at that
> point?
>
> Kind regards
>
> Michael
>

I don't know; it's your data. Did you put it in the database escaped
or unescaped? If escaped, you will have to unescape it and mark it
safe, which will avoid it being escaped when output. If unescaped, you
only have to mark it safe.

You should probably be storing it unescaped, given that your other
code path (which renders a template from a string) generates unescaped
HTML.

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



query set error

2011-05-03 Thread Yasmany Cubela Medina
'QuerySet' object has no attribute '_default_manager'

whats is the meaning of this error, i use django with python 2.7 there is any 
issue in this python version should i change to any other python version?



El ayer es un recuerdo, el mañana es un misterio y el ahora es un regalo...por 
eso se llama presente.

Ing. Yasmany Cubela Medina:
Linux user 446757
Ubuntu user 13464

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



Re: Do any financial firms use a Django framework?

2011-05-03 Thread Daniel Hilton
On 3 May 2011 15:53, rpt...@reportlab.com  wrote:
> Does anyone know of any financial firms which use a Django framework?
> I am preparing a proposal to build a web based solution for a
> financial firm using Django, and some key players there would be much
> more comfortable if I could point to some "serious" firms in finance
> or similar industries which use Django.
>
> I have googled around and found some links such as:
>
>  - http://www.djangosites.org/
>
>  - http://bostinnovation.com/2011/03/31/boston-companies-using-django/
>
> But a lot of these examples are from news and social networking
> sites.
>
> If anyone can give examples of Django being used by financial firms or
> blue-chip companies, it would be very appreciated.
>
> Thanks,
>
> Tom
Hi Tom

The UK based payment service provider Secure Trading use it[1]  as do
Accountis[2] who use python as well as they were also recruiting
django developers, if I remember correctly.

HTH
Dan

[1] http://www.securetrading.com/jobs.html
[2] http://www.accountis.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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


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



Re: Do any financial firms use a Django framework?

2011-05-03 Thread Shawn Milochik


It seems to me that anyone asking for precedent in their own industry is 
actually interested in whether Django is considered safe from things 
like the OWASP Top Ten. They're not interested enough to do the research 
themselves, so they're going to take an "argument from authority" as 
evidence of security. That is poor decision-making in addition to faulty 
logic. By their own logic, the first big company to implement Django is 
obviously being foolish, because nobody else had done it yet. In 
addition, really big companies with big budgets, large IT departments, 
and audited compliance with all the standards get hacked regularly.



The better question to ask is what kinds of security audits Django has 
passed, and what (if any) regular checks are made against target-rich 
parts of the system, such as the ORM. However, in the end Django is 
still just a framework. It could do everything right and a developer can 
make one small oversight and allow an attacker in. I guess the real 
question is whether the developer is familiar with the OWASP Top Ten and 
its ilk, and competent to write pretty good code.


For what it's worth, my company deals with debit cards and electronic 
payments, and we use Django. However, we're not a large company, nor a 
"financial firm."


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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Do any financial firms use a Django framework?

2011-05-03 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, May 3, 2011 at 4:23 PM, Shawn Milochik  wrote:

> 
> It seems to me that anyone asking for precedent in their own industry is
> actually interested in whether Django is considered safe from things like
> the OWASP Top Ten. They're not interested enough to do the research
> themselves, so they're going to take an "argument from authority" as
> evidence of security. That is poor decision-making in addition to faulty
> logic. By their own logic, the first big company to implement Django is
> obviously being foolish, because nobody else had done it yet. In addition,
> really big companies with big budgets, large IT departments, and audited
> compliance with all the standards get hacked regularly.
> 
>
> The better question to ask is what kinds of security audits Django has
> passed, and what (if any) regular checks are made against target-rich parts
> of the system, such as the ORM. However, in the end Django is still just a
> framework. It could do everything right and a developer can make one small
> oversight and allow an attacker in. I guess the real question is whether the
> developer is familiar with the OWASP Top Ten and its ilk, and competent to
> write pretty good code.
>

+1


>
> For what it's worth, my company deals with debit cards and electronic
> payments, and we use Django. However, we're not a large company, nor a
> "financial firm."
>
> 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-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hello,

On Tuesday, May 3, 2011 5:08:28 PM UTC+3, Tom Evans wrote:
>
> On Tue, May 3, 2011 at 1:43 PM, Uri Goldstein  wrote:
> > Hi Tom,
> >
> > I definitely agree that having docs is good, reading and comprehending 
> the
> > docs is better. Reading and comprehending the docs yourself you might 
> have
> > noticed the following quote: "If you were to try this and Django 
> supported
> > it, you would inevitably see a mixture of translated strings (from your
> > application) and English strings (from Django itself)." No mention of a
> > technical limitation, only of a goal to not see the mixture of translated
> > strings.
>
> Were you expecting that a new translation would automatically have the 
> correct
> translations for that language? What a strange expectation.
>
No, actually I wasn't expecting that. The strangeness here seems to be your 
understanding of what I've written. 

> The technical limitation belongs to gettext, not Django. It cannot load a
> supplementary language file when the main language file doesn't exist.
> IE, for our putative Mongolian translation, it cannot load
> your_app/locale/mn/LC_MESSAGES/django.mo if
> django/locale/mn/LC_MESSAGES/django.mo does not exist.
>
>
> That's good to know. It might even have been better had any of this even 
been hinted at in the documentation. 

> >
> > The amount of effort to "to make at least a minimal translation of the
> > Django core" might be minuscule or it might not, I find that it shouldn't 
> be
> > made necessary.
>
> You think Django should support all languages, out of the box? Do you
> have a patch?
>
I do think that and no, I don't have a patch. So?

> FYI, 'a minimal translation of the Django core' means copying the 'en'
> translation to your new language. Whether you need to translate parts
> of that depends upon whether your site needs it.
>
That's also good to know and indeed makes everything a lot simpler. I only 
wish someone could have explained that earlier in the discussion or even 
better, in the documentation.

> >
> > And finally, I am assured that this is but a small issue to deal with and
> > yet, had it not been an issue in the first place it would not have been
> > mentioned in the official docs, would it?
> >
>
> Many things are mentioned in the manual that are small issues, since they
> evidently confuse new users. This is one of them. Anyone who has used 
> gettext
> before would be aware of this issue, and it is extensively detailed in the
> gettext manual.
>
> Django's docs could easily have just said "Django uses gettext to deliver
> translatable content, refer to the gettext manual for implementation 
> details",
> but it does more to help out new users.
>
>
> Bottom line: Django supports adding translations for as many languages
> as you like, but cannot and will not magically have translations for
> any languages which it does not support. You, as the website
> developer, are free to add languages that Django does not support, and
> doing so is a few trivial steps.
>
Small issues are still issues. New users such as myself might not have any 
experience with gettext and could, just like myself, be very surprised to 
learn of quirks like this. Even if it isn't Django's "fault", it scares 
people like me into thinking they could run into big problems with 
unsupported languages. It would wiser for Django to have simpler and more 
concrete explanations in the documentation. Nothing wrong with helping 
newbies learn faster.

If the issue cannot be resolved then it might be beneficial to explain it 
better:

   1. If the issue is driven by technical difficulty stemming from xgettext 
   then don't excuse it as an attempt to prevent "a mixture of translated 
   strings".
   2. "A good starting point is to copy the Django English .po file and to 
   translate at least some *translation 
strings*."
 
   is better explained by adding "from /conf/locale/en" to the corresponding 
   folder for the new language.


Cheers
Uri

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



Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ



MikeKJ wrote:
> 
> 
> data is stored as This is an exampleof the text
> content 
> 
> Is that escaped or unescaped, if it is unescaped then it is being escaped
> elsewhere before it gets to be rendered to the template
> 
> Thx
> 

That is unescaped html.. I believe

-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31534014.html
Sent from the django-users mailing list archive at Nabble.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.



Re: escaping (where is the exit)

2011-05-03 Thread MikeKJ


data is stored as This is an exampleof the text
content 

Is that escaped or unescaped, if it is unescaped then it is being escaped
elsewhere before it gets to be rendered to the template

Thx
-- 
View this message in context: 
http://old.nabble.com/escaping-%28where-is-the-exit%29-tp31531487p31533994.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Do any financial firms use a Django framework?

2011-05-03 Thread MikeKJ


Aviva (ex Norwich Union) use django they are a big player in insurance
markets 
-- 
View this message in context: 
http://old.nabble.com/Do-any-financial-firms-use-a-Django-framework--tp31533283p31534053.html
Sent from the django-users mailing list archive at Nabble.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.



Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread А . Р .
2011/5/3 Ariel <...@gmail.com>:
> In my apache enviroment settings I have already set that:
>
> export LANG='en_US.UTF-8'
> export LC_ALL='en_US.UTF-8'
>
> But I still get the same error. Bedsides I am using wsgi no modpython.
>
> Please, could somebody help me ???
> Regards
> Thanks in advance.
> Ariel
>

You're getting this on the production environment only?
Anyway, there is not enough information.
All I can propose is using winpdb for debug:
http://code.djangoproject.com/wiki/DebuggingDjangoWithWinpdb

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



Re: Form with manytomany field

2011-05-03 Thread Bryan
"Maybe what I need is something like OneToMany relationship"
You need a ManyToMany field: multiple people may have worked for the
same company previously, correct?

As for your original question, I would make a ModelForm for your
Person model (or whatever it is) and another one for your Company
model and then use a formset to allow them to enter the companies
they've worked for. This should get part of the way there:
http://docs.djangoproject.com/en/1.3/topics/forms/formsets/#using-more-than-one-formset-in-a-view

Hope that helps.

On May 2, 6:37 pm, Daniel França  wrote:
> anyone?
> Maybe what I need is something like OneToMany relationship, i guess, but
> there's no such thing in django
>
> 2011/5/2 Daniel França > Hi all,
> > I'm trying to create a form from a model with ManyToManyField,
> > I want something like this: You fill some fields from the referenced table
> > and you click at 'Add' and this appears at a table below the fields, so when
> > I click
> > "Save" all the added items save (includind the new manytomany items)
>
> > Example:
>
> > *Name [                              ]*
> > *Email [                              ]*
>
> > *Add Companys you've Worked for:*
> > *Company [                               ]  Telephone [
> >              ]   (ADD Button)*
> > *
> > --- 
> > -
> > *
> > *Company                    Telephone*
> > *Company XYZ              555 0123*
> > *Company ABC              123 4567*
> > *
> > *
> > *(Save Form Button)*
> > *
> > *
>
> > I hope you can understand this... there's some easy way to implement this
> > using Django?
>
> > Best Regards,
> > Daniel França

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



Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
I've read the following and am still stuck and wondering what piece of this 
puzzle
I am missing.  If anyone has any ideas, please do comment!

http://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

Using the Django 1.3 development webserver, everything works fine. 
 Migrating to
Apache 2.x with WSGI 3.3, not so much.  The WSGI part of the picture seems 
to
function as intended, but not with my Django stuff.

Visiting / gives me the *expected* 404 (see urls.py below)

Visiting /admin (which is really the entirety of my needs) gives me: "Site 
matching query does not exist."

--- BEGIN Apache config --

  ServerName rcf-hostdb.our.org

  # A single dir with nothing else but our WSGI wrapper, for security
  
Order allow,deny
Allow from all
  

  # Handle all requests via the WSGI wrapper, django.wsgi
  WSGIScriptAlias / 
/rcfwebapps/apps/hostdb/hostdb_project/apache/django.wsgi

  # And one other directory for storing static files, like CSS, favicon.ico
  
Order deny,allow
Allow from all
  

  # Now redefine where to find those static files (not via WSGI)
  Alias /robots.txt /rcfwebapps/apps/hostdb/hostdb_project/static/robots.txt
  Alias /favicon.ico 
/rcfwebapps/apps/hostdb/hostdb_project/static/favicon.ico
  AliasMatch ^/([^/]*\.css) 
/rcfwebapps/apps/hostdb/hostdb_project/static/styles/$1
  Alias /media/ /rcfwebapps/apps/hostdb/hostdb_project/static/media/


-- END Apache Config -

-- BEGIN url mapping -
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
)
-- END url mapping -

-- BEGIN apache/django.wsgi 
#!/rcfwebapps/apps/hostdb/bin/python import os import sys path = 
'/rcfwebapps/apps/hostdb' if path not in sys.path: sys.path.append(path) 
os.environ['DJANGO_SETTINGS_MODULE'] = 'hostdb_project.settings' 
os.environ['PYTHON_EGG_CACHE'] = '/rcfwebapps/apps/hostdb/egg-cache' import 
django.core.handlers.wsgi application = 
django.core.handlers.wsgi.WSGIHandler()
--- END django.wsgi 

My "site" directory tree is as follows (the site is 'hostdb_project' with 1 
app named
'hostdb'):

 |-agent--
 |-apache-
 |
 ||-admin|-hostdb-
 |-hostdb-|-fixtures-
|-hostdb_project-||-static---
 |
 |   |-css (symlink to 
django/contrib/admin/media/css)
 |-static-|-media|-img (symlink to 
django/contrib/admin/media/img)
  |  |-js (symlink to 
django/contrib/admin/media/js)
  |-styles---

Full exception copy/paste:

Environment: Request Method: GET Request URL: 
http://rcf-hostdb.our.org/admin/ Django Version: 1.3 Python Version: 2.7.1 
Installed Applications: ['django.contrib.auth', 
'django.contrib.contenttypes', 'django.contrib.sessions', 
'django.contrib.sites', 'django.contrib.messages', 
'django.contrib.staticfiles', 'hostdb', 'django.contrib.admin'] Installed 
Middleware: ('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware') Traceback: File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/core/handlers/base.py"
 
in get_response 111. response = callback(request, *callback_args, 
**callback_kwargs) File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/contrib/admin/sites.py"
 
in wrapper 214. return self.admin_view(view, cacheable)(*args, **kwargs) 
File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/utils/decorators.py"
 
in _wrapped_view 93. response = view_func(request, *args, **kwargs) File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func 79. response = view_func(request, *args, **kwargs) 
File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/contrib/admin/sites.py"
 
in inner 196. return self.login(request) File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func 79. response = view_func(request, *args, **kwargs) 
File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/contrib/admin/sites.py"
 
in login 331. return login(request, **defaults) File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/utils/decorators.py"
 
in _wrapped_view 93. response = view_func(request, *args, **kwargs) File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func 79. response = view_func(request, *args, **kwargs) 
File 
"/rcfwebapps/apps/hostdb/lib/python2.7/site-packages/django/contrib/auth/views.py"
 
in login 59. current_site = get_current_site(request) File 
"/rcfwebapps/apps/hostd

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Daniel Roseman


On Tuesday, May 3, 2011 6:38:40 PM UTC+1, Jeff Blaine wrote:
>
> I've read the following and am still stuck and wondering what piece of this 
> puzzle
> I am missing.  If anyone has any ideas, please do comment!
>
> http://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
>
> http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> Using the Django 1.3 development webserver, everything works fine. 
>  Migrating to
> Apache 2.x with WSGI 3.3, not so much.  The WSGI part of the picture seems 
> to
> function as intended, but not with my Django stuff.
>
> Visiting / gives me the *expected* 404 (see urls.py below)
>
> Visiting /admin (which is really the entirety of my needs) gives me: "Site 
> matching query does not exist."
>
> 
> Exception Type: DoesNotExist at /admin/ Exception Value: Site matching 
> query does not exist. 
>
>
I don't know why you think this is a WSGI error. As you say, Apache is 
finding your WSGI app with no problem, and the error you get is a Django one 
- you simply don't seem to have any data in your Site table, whereas the 
Django admin requires one.
--
DR.

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



Django Admin template

2011-05-03 Thread Rich
I know it's possible to overwrite the Django admin templates by
copying the templates to your local project.  I want to modify the
"add user" template but cannot seem to figure out which template it
is.  I want to create a button which will use APG to generate a random
password rather than typing in the password.  Anyone, have any idea
how this can be accomplished.

Thanks,
Richard

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



Re: Django Admin template

2011-05-03 Thread Shawn Milochik
You can check out the urls.py in admin and use that to find the view and 
template.


http://code.djangoproject.com/browser/django/trunk/django/contrib/auth?order=name

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 2:03:14 PM UTC-4, Daniel Roseman wrote:
>
> I don't know why you think this is a WSGI error. As you say, Apache is 
> finding your WSGI app with no problem, and the error you get is a Django one 
> - you simply don't seem to have any data in your Site table, whereas the 
> Django admin requires one.
>

Daniel, thanks for taking time out to reply.

I didn't say it was a WSGI error.  I said I am stuck at the WSGI integration 
step and "The WSGI part of the picture seems to function as intended, but 
not with my Django stuff."

Note too that I said Django admin works fine with the same database via the 
development webserver.  If "Django admin" requires something I am missing, I 
would not expect it to work under the development server, but I'm eager to 
learn anything you can share.

 

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



Re: Django Admin template

2011-05-03 Thread Rich
Thanks! I will check out urls.py to find the template for that view

On May 3, 2:38 pm, Shawn Milochik  wrote:
> You can check out the urls.py in admin and use that to find the view and
> template.
>
> http://code.djangoproject.com/browser/django/trunk/django/contrib/aut...

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



Re: Django Admin template

2011-05-03 Thread Jacob Kaplan-Moss
On Tue, May 3, 2011 at 1:23 PM, Rich  wrote:
> I know it's possible to overwrite the Django admin templates by
> copying the templates to your local project.  I want to modify the
> "add user" template but cannot seem to figure out which template it
> is.  I want to create a button which will use APG to generate a random
> password rather than typing in the password.  Anyone, have any idea
> how this can be accomplished.

You should check out the docs:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates.
That bit walks you through the process, which is basically creating an
"admin///.html" template with the app-specific
template you'd like. The docs list each template that can be
overridden; the one you want is "change_form.html". So since you're
working on the "user" model in the "auth" app you'd create a template
named "admin/auth/user/change_form.html".

Hope that helps,

Jacob

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



Re: Django Admin template

2011-05-03 Thread Rich
Thanks! Jacob.  I will check it out.

Richard

On May 3, 2:50 pm, Jacob Kaplan-Moss  wrote:
> On Tue, May 3, 2011 at 1:23 PM, Rich  wrote:
> > I know it's possible to overwrite the Django admin templates by
> > copying the templates to your local project.  I want to modify the
> > "add user" template but cannot seem to figure out which template it
> > is.  I want to create a button which will use APG to generate a random
> > password rather than typing in the password.  Anyone, have any idea
> > how this can be accomplished.
>
> You should check out the 
> docs:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-ad
> That bit walks you through the process, which is basically creating an
> "admin///.html" template with the app-specific
> template you'd like. The docs list each template that can be
> overridden; the one you want is "change_form.html". So since you're
> working on the "user" model in the "auth" app you'd create a template
> named "admin/auth/user/change_form.html".
>
> Hope that helps,
>
> Jacob

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



Re: Django Admin template

2011-05-03 Thread Juan Pablo Romero Méndez
For this, django-google-toolbar is invaluable. It tells you exactly which
templates were used in rendering some url.

Coupled with pycharm's "find file by name" feature (Ctrl+Shift+N) it names
really easy to jump to any name file.

Regards,

  Juan Pablo

2011/5/3 Rich 

> I know it's possible to overwrite the Django admin templates by
> copying the templates to your local project.  I want to modify the
> "add user" template but cannot seem to figure out which template it
> is.  I want to create a button which will use APG to generate a random
> password rather than typing in the password.  Anyone, have any idea
> how this can be accomplished.
>
> Thanks,
> Richard
>
> --
> 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.



Select list populated from an object method (admin app)

2011-05-03 Thread Juan Pablo Romero Méndez
Hello,

I wonder if there's an easy way to do the following (besides modifying
"contrib.admin.templates.admin.includes.fieldset.html"):

I have a model which uses django-workflows, so for each instance and every
user I can do:   get_allowed_transitions(obj,user), and
obtain a list of Transition objects.

What I'd like is to do is to populate a select list in the change_form  with
the list of transitions allowed for the object.

The tricky thing is that for this list to be calculated, the code needs
access to the current user.

Regards,

  Juan Pablo

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



Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread Ariel
Yes, only on the production enviroment.

Regards

2011/5/3 А. Р. <4d876...@gmail.com>

> 2011/5/3 Ariel <...@gmail.com>:
> > In my apache enviroment settings I have already set that:
> >
> > export LANG='en_US.UTF-8'
> > export LC_ALL='en_US.UTF-8'
> >
> > But I still get the same error. Bedsides I am using wsgi no modpython.
> >
> > Please, could somebody help me ???
> > Regards
> > Thanks in advance.
> > Ariel
> >
>
> You're getting this on the production environment only?
> Anyway, there is not enough information.
> All I can propose is using winpdb for debug:
> http://code.djangoproject.com/wiki/DebuggingDjangoWithWinpdb
>
> --
> 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.



Re: Implementing a ldap db backend

2011-05-03 Thread Jeremy Lainé

> I have thought of many solutions to replace ldapdb. I came to
> conclusion than the cleanest, and most useful for the community, would
> be to implement a real db backend forldap. However, I have been told
> that it is an awfully big task !

FYI, I have refactored django-ldapdb so that it is now a proper
database backend. As an added bonus, thanks to django's multi-database
support you can now have multiple LDAP connections and use a router to
direct read/writes to the proper LDAP connection.

Cheers,
Jeremy

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
Also, adding an example.com site (via /admin via dev server) doesn't change 
the behavior.  Same error.  I'm not sure if that's what you were suggesting 
to do or not.

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



Re: Select list populated from an object method (admin app)

2011-05-03 Thread Juan Pablo Romero Méndez
Ok, I learned about ModelAdmin.formfield_for_foreignkey, which let's me
access the current user.

What I can't find now is the instance asociated the db_field parameter.



El 3 de mayo de 2011 14:19, Juan Pablo Romero Méndez <
jpablo.rom...@gmail.com> escribió:

> Hello,
>
> I wonder if there's an easy way to do the following (besides modifying
> "contrib.admin.templates.admin.includes.fieldset.html"):
>
> I have a model which uses django-workflows, so for each instance and every
> user I can do:   get_allowed_transitions(obj,user), and
> obtain a list of Transition objects.
>
> What I'd like is to do is to populate a select list in the change_form
>  with the list of transitions allowed for the object.
>
> The tricky thing is that for this list to be calculated, the code needs
> access to the current user.
>
> Regards,
>
>   Juan Pablo
>

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



Re: CSS linking error

2011-05-03 Thread Oleg Lomaka
It looks you have unnecessary 'static' part in your template. MEDIA_ROOT
already contains 'static', so template should looks like this:



On Tue, May 3, 2011 at 12:21 PM, Pascal Moutia wrote:

> Hi there Django-users
>
> I'm suppose to link CSS to my base.html but i can't get it worked :s there
> is my url line:
>
>
> if settings.DEBUG:
>urlpatterns += patterns('',
>url(r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': settings.PROJECT_PATH+'/static/', 'show_indexes': True}),
> )
>
>
> and my html link with the MEDIA_URL setting:
>
> link rel="stylesheet" type="text/css" media="screen" href="{{ MEDIA_ROOT
> }}static/css/style.css" />
>
> import os.path
> PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
>
> MEDIA_ROOT = os.path.join(PROJECT_PATH, '/static/')
>
>

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
I'd certainly like to hear more about this, but I got it all working fine by 
commenting out 'django.contrib.sites' from INSTALLED_APPS

That's obviously not the right solution...

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jacob Kaplan-Moss
Hi Jeff --

To make the admin work w/r/t sites, you'll need three things:

* An entry in the sites table.
* A setting SITE_ID set to the ID of the Site entry you'd like to use
(i.e. SITE_ID = 1).
* `django.contrib.sites` in your INSTALLED_APPS.

Check all three; I'll be you're missing one or two of them.

Jacob

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



Odp: Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread Tomasz Zieliński
W dniu wtorek, 3 maja 2011, 21:34:28 UTC+2 użytkownik Ariel napisał:
>
> Yes, only on the production enviroment.
>
>
>  
Try to create a file with UTF8 characters in its name, from your code. 
Then you'll know if those Apache settings are in effect.

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



removing the source of a OneToOneField relationship

2011-05-03 Thread Seth Gordon
I have one Django model that points to another one with a OneToOneField,
sort of like this:

class Target(models.model):
# stuff

class Source(models.Model):
target = models.OneToOneField(Target)

Sometimes, given an object that is an instance of Target, I want to
navigate to its Source and delete that:

try:
some_target.source.delete()
except ObjectDoesNotExist:
## nothing to delete!
pass

But this doesn't work: some_target.source will still exist after the
delete() operation has been performed.  If I try "some_target.source =
None", I get an exception, complaining that Target.source does not allow
null values.  Calling save() and clean_fields() at strategic moments
doesn't seem to work, either.

What does seem to work is reloading the Target object:

try:
some_target.source.delete()
some_target = Target.objects.get(pk=some_target.id)
except Source.DoesNotExist:
## nothing to delete!
pass

Is this a bug in Django, or am I misunderstanding how related or cached
objects are supposed to work?

This is Django 1.2.3, Python 2.6.5, PostgreSQL 8.4.7, all running on
Ubuntu Linux 10.04.

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



Save M2M "Through" Fields on ModelAdmin or ModelForm Save

2011-05-03 Thread jough
Apparently Django's ModelAdmin/ModelForm doesn't allow you to use
save_m2m() if there's an intermediate through table for a
ManyToManyField.

If I have a model such as:

class MyModel(models.Model):
created = models.DateTimeField()
many = models.ManyToManyField("RelatedModel",
through="RelatedToMyModel")

def save(self, *args, **kwargs):
self.created = datetime.datetime.now()
super(MyModel, self).save(*args, **kwargs)

class RelatedModel(models.Model):
field = models.CharField(max_length=32)

class RelatedToMyModel(models.Model):
my_model = models.ForeignKey(MyModel)
related_model = models.ForeignKey(RelatedModel)
additional_field = models.CharField(max_length=32)

And you use a simple Django ModelAdmin:

class = RelatedToMyModelInline(admin.TabularInline):
model = MyModel.many.through

class MyModelAdminForm(forms.ModelForm):
class Meta:
model = MyModel

class MyModelAdmin(admin.ModelAdmin):
form = MyModelAdminForm
inlines = (RelatedToMyModelInline, )

If I save MyModel first and then add a new related through model via
the inline it works fine, but if I try to set the inline while also
adding data for a new MyModel, I get the Django Admin error "Please
correct the error below." with nothing highlighted below.

How can I have it save MyModel and then save the inline intermediary
models after? Clearly Django can save the through model once it has
saved MyModel - so I'm just looking for a hook into that. I tried
overriding the form's save() method by calling save_m2m() after
calling instance.save(), but apparently that doesn't work for M2Ms
with a through table.

I'm using Django 1.2, but apparently this is still an issue in 1.3.

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



Re: Django Admin template

2011-05-03 Thread roberto
django-google-toolbar ? or django-debug-toolbar ?

I am asking because I wasn't able to find anything about the first
one.

Tks.

Roberto

On May 3, 4:10 pm, Juan Pablo Romero Méndez 
wrote:
> For this, django-google-toolbar is invaluable. It tells you exactly which
> templates were used in rendering some url.
>
> Coupled with pycharm's "find file by name" feature (Ctrl+Shift+N) it names
> really easy to jump to any name file.
>
> Regards,
>
>   Juan Pablo
>
> 2011/5/3 Rich 
>
>
>
>
>
>
>
> > I know it's possible to overwrite the Django admin templates by
> > copying the templates to your local project.  I want to modify the
> > "add user" template but cannot seem to figure out which template it
> > is.  I want to create a button which will use APG to generate a random
> > password rather than typing in the password.  Anyone, have any idea
> > how this can be accomplished.
>
> > Thanks,
> > Richard
>
> > --
> > 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.



Re: Django Admin template

2011-05-03 Thread Shawn Milochik

On 05/03/2011 05:39 PM, roberto wrote:

django-google-toolbar ? or django-debug-toolbar ?



The latter. The former must have been a typo.

https://github.com/robhudson/django-debug-toolbar


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



Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Thomas Weholt
Hi,

Just posted a new blog about more realistic performance of DSE against
a real database. Head over to http://weholt.blogspot.com/ to read it.

Thanks for your feedback!

Regards,
Thomas

On Tue, May 3, 2011 at 1:55 PM, Brian Bouterse  wrote:
> This would have been so useful on my last project.  14.4 Million records
> took a couple of days with a single thread using the ORM.  This would have
> really sped things up.
> Brian
>
> On Tue, May 3, 2011 at 7:50 AM, Thomas Weholt 
> wrote:
>>
>> Inserting, updating or deleting lots of records using the Django ORM?
>> Want better performance? Check out DSE!
>>
>> It's free, released under the GPL licence. More information about the
>> possible performance gain can be seen here:
>>
>> http://weholt.blogspot.com/2011/05/dse-uses-18-of-time-compared-to-django.html
>>
>> DSE at pypi:
>> http://pypi.python.org/pypi/dse/
>>
>> Source at bitbucket.org:
>> https://bitbucket.org/weholt/dse2
>>
>> Thanks for your attention.
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.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-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.
>>
>
>
>
> --
> Brian Bouterse
> ITng Services
>
> --
> 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.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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-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.



Form hidden filed for foreign key - validation error

2011-05-03 Thread Boris Tomic
I want to have foreign key in form displayed as hidden field. I will
be using javascript to populate this field.

Model is defined as:

contactid = models.ForeignKey(Contact, blank = True, null = True,
on_delete = models.PROTECT)

I tried to define form field as:

contactid = ModelChoiceField(queryset=Contact.objects.all(),
widget=HiddenInput())

but I then get validation error (This field is required.).

Is there way to display foreign key form field as input (hidden)?

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 4:42:25 PM UTC-4, Jacob Kaplan-Moss wrote:
>
> Hi Jeff --
>
> To make the admin work w/r/t sites, you'll need three things:
>
> * An entry in the sites table.
> * A setting SITE_ID set to the ID of the Site entry you'd like to use
> (i.e. SITE_ID = 1).
> * `django.contrib.sites` in your INSTALLED_APPS
>

Thanks Jacob -- does the site entry in the database have to be anything 
specific?  We don't really use that.  Just put any old thing in there via 
Admin in the development server?

I have a SITE_ID = 1 in settings.py from, I assume, when the project was 
made.  I suspect when I deleted the 'example.com' site last week, that broke 
the relationship, no?

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



Re: Form hidden filed for foreign key - validation error

2011-05-03 Thread Boris Tomic
I have added (required=False) to field:
> contactid = ModelChoiceField(queryset=Contact.objects.all(),
> widget=HiddenInput())
>

so now I have:
contactid = ModelChoiceField(queryset=Contact.objects.all(),
widget=HiddenInput(), required=False)

and it seems to be working. To me this looks as bug but maybe it is
feature.

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



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jacob Kaplan-Moss
On Tue, May 3, 2011 at 5:07 PM, Jeff Blaine  wrote:
> Thanks Jacob -- does the site entry in the database have to be anything
> specific?  We don't really use that.  Just put any old thing in there via
> Admin in the development server?

Well, if you want all the parts of the admin to work correctly
(especially those "view on site" buttons and similar features) you
probably should set the entry to something that actually exists.
Django will happily think your site is running on
http://www.example.com/, but I really doubt that it is.

> I have a SITE_ID = 1 in settings.py from, I assume, when the project was
> made.  I suspect when I deleted the 'example.com' site last week, that broke
> the relationship, no?

Probably, yes.

When Django needs to know which site it's running on it does something like::

Site.objects.get(id=settings.SITE_ID)

If you've broken that (by deleting the site object, changing SITE_ID,
taking django.contrib.sites out of INSTALLED_APPS, etc.) then it won't
quite work, as you might imagine.

Jacob

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



Re: Form with manytomany field

2011-05-03 Thread Daniel França
Foreign Key won't generate the form from model this way I told
I'm trying to escape from use of extensive javascript

On Tue, May 3, 2011 at 5:46 AM, Daniel Roseman wrote:

> On Tuesday, 3 May 2011 02:37:56 UTC+1, daniel.franca wrote:
>>
>> anyone?
>> Maybe what I need is something like OneToMany relationship, i guess, but
>> there's no such thing in django
>>
>> Er, what? What about ForeignKey?
>
> Anyway, what you need is inline model formsets:
>
> http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#inline-formsets
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Form with manytomany field

2011-05-03 Thread Daniel França
Thanks, I guess this is exactly what I need, I'look at that =)
PS: The Company form was just an example, I've some cases of this at my
code.

On Tue, May 3, 2011 at 2:25 PM, Bryan  wrote:

> "Maybe what I need is something like OneToMany relationship"
> You need a ManyToMany field: multiple people may have worked for the
> same company previously, correct?
>
> As for your original question, I would make a ModelForm for your
> Person model (or whatever it is) and another one for your Company
> model and then use a formset to allow them to enter the companies
> they've worked for. This should get part of the way there:
>
> http://docs.djangoproject.com/en/1.3/topics/forms/formsets/#using-more-than-one-formset-in-a-view
>
> Hope that helps.
>
> On May 2, 6:37 pm, Daniel França  wrote:
> > anyone?
> > Maybe what I need is something like OneToMany relationship, i guess, but
> > there's no such thing in django
> >
> > 2011/5/2 Daniel França > Hi all,
> > > I'm trying to create a form from a model with ManyToManyField,
> > > I want something like this: You fill some fields from the referenced
> table
> > > and you click at 'Add' and this appears at a table below the fields, so
> when
> > > I click
> > > "Save" all the added items save (includind the new manytomany items)
> >
> > > Example:
> >
> > > *Name [  ]*
> > > *Email [  ]*
> >
> > > *Add Companys you've Worked for:*
> > > *Company [   ]  Telephone [
> > >  ]   (ADD Button)*
> > > *
> > >
> ---
> -
> > > *
> > > *CompanyTelephone*
> > > *Company XYZ  555 0123*
> > > *Company ABC  123 4567*
> > > *
> > > *
> > > *(Save Form Button)*
> > > *
> > > *
> >
> > > I hope you can understand this... there's some easy way to implement
> this
> > > using Django?
> >
> > > Best Regards,
> > > Daniel França
>
> --
> 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.



Re: Do any financial firms use a Django framework?

2011-05-03 Thread Russell Keith-Magee
On Tue, May 3, 2011 at 10:53 PM, rpt...@reportlab.com
 wrote:
> Does anyone know of any financial firms which use a Django framework?
> I am preparing a proposal to build a web based solution for a
> financial firm using Django, and some key players there would be much
> more comfortable if I could point to some "serious" firms in finance
> or similar industries which use Django.
>
> I have googled around and found some links such as:
>
>  - http://www.djangosites.org/
>
>  - http://bostinnovation.com/2011/03/31/boston-companies-using-django/
>
> But a lot of these examples are from news and social networking
> sites.
>
> If anyone can give examples of Django being used by financial firms or
> blue-chip companies, it would be very appreciated.

Macquarie -- one of Australia's biggest banking and insurance groups
-- use Django as part of the in their Macquarie Edge share trading
platform. Edge itself isn't built using Django, but the news
processing backend that feeds Edge is built using Django.

http://huntedmedia.com/macquarieedge.html

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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 6:33:20 PM UTC-4, Jacob Kaplan-Moss wrote:
>
> On Tue, May 3, 2011 at 5:07 PM, Jeff Blaine  wrote:
> > Thanks Jacob -- does the site entry in the database have to be anything
> > specific?  We don't really use that.  Just put any old thing in there via
> > Admin in the development server?
>
> Well, if you want all the parts of the admin to work correctly
> (especially those "view on site" buttons and similar features) you
> probably should set the entry to something that actually exists.
>
Ah, I wasn't aware of such features.  We're using "Admin AS the site" due to 
our
needs for a direct web front-end to a database without custom "content" as 
it
were or media of any sorts.  It's a host/asset database for internal use by 
20
people.  For now, we'd rather not be writing load of templates that almost
completely reproduce what 'Admin' gives us already.  That may change, and
if it does, I understand the point of 'Sites' now as they relate to the 
admin
interface.  I also went and read the reference doc on sites.

Thank you.

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



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Karen Tracey
On Tue, May 3, 2011 at 8:11 AM, Tom Evans  wrote:

> If you require your site
> to be in Mongolian, it can be in Mongolian, even though Django does
> not itself have a Mongolian translation,
>

Need a better example. Django has had a Mongolian translation for a year
now: http://code.djangoproject.com/changeset/13092.

Karen
-- 
http://tracey.org/kmt/

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



Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Brian Bouterse
I will definitely be using this next time.  Nice post.

Brian

On Tue, May 3, 2011 at 5:50 PM, Thomas Weholt wrote:

> Hi,
>
> Just posted a new blog about more realistic performance of DSE against
> a real database. Head over to http://weholt.blogspot.com/ to read it.
>
> Thanks for your feedback!
>
> Regards,
> Thomas
>
> On Tue, May 3, 2011 at 1:55 PM, Brian Bouterse  wrote:
> > This would have been so useful on my last project.  14.4 Million records
> > took a couple of days with a single thread using the ORM.  This would
> have
> > really sped things up.
> > Brian
> >
> > On Tue, May 3, 2011 at 7:50 AM, Thomas Weholt 
> > wrote:
> >>
> >> Inserting, updating or deleting lots of records using the Django ORM?
> >> Want better performance? Check out DSE!
> >>
> >> It's free, released under the GPL licence. More information about the
> >> possible performance gain can be seen here:
> >>
> >>
> http://weholt.blogspot.com/2011/05/dse-uses-18-of-time-compared-to-django.html
> >>
> >> DSE at pypi:
> >> http://pypi.python.org/pypi/dse/
> >>
> >> Source at bitbucket.org:
> >> https://bitbucket.org/weholt/dse2
> >>
> >> Thanks for your attention.
> >>
> >> --
> >> Mvh/Best regards,
> >> Thomas Weholt
> >> http://www.weholt.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-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.
> >>
> >
> >
> >
> > --
> > Brian Bouterse
> > ITng Services
> >
> > --
> > 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.
> >
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.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-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.



django admin site and debug

2011-05-03 Thread Yasmany Cubela Medina
i have the django admin site enabled and it work at perfect with debug flag set 
to true, but when i change to false throwme the page not found template in the 
edit pages of any module in the admin interface.

any help



El ayer es un recuerdo, el mañana es un misterio y el ahora es un regalo...por 
eso se llama presente.

Ing. Yasmany Cubela Medina:
Linux user 446757
Ubuntu user 13464

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



Re: django 1.1 performance versus django 1.2 performance

2011-05-03 Thread Steve Holden
Don't know whether this is relevant or not but the Python Software
Foundation has just decided to establish a facility that allows speed
comparison of different Python releases. The thinking behind this is (at
least) twofold:

1) People will more easily be able to determine which is the best Python
implementation for them to use on their specific problems, and

2) Developers will be able to see relatively easily whether their changes
make a positive or negative difference to performance, which /might/ help
eliminate the performance sawtoooth (gets worse with a major release and
then minor releases incre,entally improve it).

I don't know whether we can share our shiny new hardware with anyone else,
though ;-)

regards
 Stefe

On Sat, Apr 23, 2011 at 1:19 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> > On Fri, Apr 22, 2011 at 9:22 PM, Shawn Milochik 
> wrote:
> >>
> >> This was mentioned in Eric Florenzano's talk at DjangoCon 2010. Each
> >> version has gotten slower.
> >>
> >> I haven't heard anything about the cause or plans to fix this, though.
> >> If you've got a good test suite you can always use tools like Python's
> >> profile module to track down slowdowns in your Django code and
> >> contribute that knowledge to the developers' list.
> >>
>
> On Sat, Apr 23, 2011 at 11:26 AM, Peter Portante
>  wrote:
> > Is there a plan in place to address this?
>
> No - there isn't a plan to address this, because it isn't clear what "this"
> is.
>
> While it is known that there has been a slowdown between versions,
> that slowdown has been accompanied by a massive increase in
> functionality -- for example, the 1.1->1.2 transition introduced
> support for multiple databases. To the best of my knowledge, the
> performance slowdown highlighted by Eric at Djangocon was relatively
> small - 5-10%, not on the order of 30-50% slowdown. This matches with
> my personal experience of upgrading.
>
> There are two performance issues in database operations that I'm aware
> of that people commonly point to.
>
> Firstly -- deep cloning of query sets. Cloning a queryset is an
> expensive operation, and if you are making extensive use of operations
> that clone (e.g., very long chains of complex filters) you may see
> performance issues. This isn't something that can be easily avoided --
> in order to preserve the API guarantees of a query set, deep cloning
> is required.
>
> Secondly, the backwards compatibility infrastructure introduced in
> order to support multiple databases. In order to guarantee backwards
> compatibility, the value preparation methods on fields needed to use
> some moderately expensive introspection methods. However because these
> methods were introduced for 1.2, and we're currently preparing 1.4,
> these introspection methods have just been removed from trunk.
>
> Beyond these two issues -- we're always interested in improving
> performance, so if you can identify a specific performance issue,
> we're happy to look at it. The more evidence you can provide (profile
> runs, sample queries that are observably slower, and so on), the
> easier it will be to address these problems.
>
> 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-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.
>
>


-- 
Steve Holden+1 571 484 6266  +1 800 494 3119
Holden Web LLC http://www.holdenweb.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.



Re: removing the source of a OneToOneField relationship

2011-05-03 Thread Andy McKay

On 2011-05-03, at 2:05 PM, Seth Gordon wrote:
> I get an exception, complaining that Target.source does not allow
> null values.

You'll probably want to allow null values on your OneToOne field then:

http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.null
--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

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



Re: removing the source of a OneToOneField relationship

2011-05-03 Thread Andy McKay

On 2011-05-03, at 2:05 PM, Seth Gordon wrote:
> I get an exception, complaining that Target.source does not allow
> null values.

You'll probably want to allow null values on your OneToOne field then:

http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.null
--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

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



Re: django admin site and debug

2011-05-03 Thread vikalp sahni
are you using it on any webserver or on django management server (manage.py
runserver) at some port??

it can happen if in any of your urls.py you have mentioned something
specefic to DEBUG variable. But its quite a strage behaviour.

more inputs on your installation or how you are running will be able to put
more light on it.

Also just check if its 404 or 500 error when you put debug false.

Regards,
//Vikalp

On Wed, May 4, 2011 at 7:30 AM, Yasmany Cubela Medina
wrote:

>  i have the django admin site enabled and it work at perfect with debug
> flag set to true, but when i change to false throwme the page not found
> template in the edit pages of any module in the admin interface.
>
>
> any help
>
>
>
> 
>
> El ayer es un recuerdo, el mañana es un misterio y el ahora es un
> regalo...por eso se llama presente.
>
>
> Ing. Yasmany Cubela Medina:
>
> Linux user 446757
>
> Ubuntu user 13464
>
> --
> 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.



Re: What is Module and where to use them wisely

2011-05-03 Thread doniyor
ok it was stupid question, i wanted to ask some other thing

On May 3, 1:09 pm, Tom Evans  wrote:
> On Tue, May 3, 2011 at 10:17 AM, doniyor  wrote:
> > Hey guys,
>
> > i have got a simple but sometimes confusing issue:
>
> > what is module and can i use it both in global urls.py  and in local
> > urls.py ? i wonder, which one is a wise way ?
>
> > thanks much,
>
> > doni
>
> Your question makes no sense. A module is a python file - eg urls.py
> is a python module named 'urls'.
>
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 09:15 -0700, Uri Goldstein wrote:
> If the issue cannot be resolved then it might be beneficial to explain
> it 
> better:
> 
>1. If the issue is driven by technical difficulty stemming from
> xgettext 
>then don't excuse it as an attempt to prevent "a mixture of
> translated 
>strings".
>2. "A good starting point is to copy the Django English .po file
> and to 
>translate at least some *translation
> strings*."
>  
>is better explained by adding "from /conf/locale/en" to the
> corresponding 
>folder for the new language. 

please file a ticket - the documentation is mainly written by
developers, and I find they are very responsive to comments from end
users who find some things confusing. I am an end user, and I find that
nearly *all* my tickets wrt documentation have been accepted.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Odp: Re: Problem uploading images and videos with filenames containing not ascii characters

2011-05-03 Thread urukay
Or try to change the name of the file when uploading the image/file.
That's how solved it. Had couple problems with it also in development
enviroment and now it's working ok. Haven't tested yet in production,
but it should work too.

Radovan

On 3. Máj, 22:56 h., Tomasz Zieliński
 wrote:
> W dniu wtorek, 3 maja 2011, 21:34:28 UTC+2 użytkownik Ariel napisał:
>
> > Yes, only on the production enviroment.
>
> Try to create a file with UTF8 characters in its name, from your code.
> Then you'll know if those Apache settings are in effect.
>
> --
> Tomasz Zielinski
> 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-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.