Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread Xavier Ordoquy
Hi there, I have faced this kind of error a couple of times when the local wasn't correctly set on the system. Within the python interpreter it was C (ie ascii) where it should have been UTF8. Up to now, all have been resolved by correctly setting the locals system wide and within the web

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread kenneth gonsalves
On Thu, 2012-06-14 at 23:46 +0200, Hendrik Speidel wrote: > as an alternative you can provide your own Storage implementation like > outlined here: > > http://source.mihelac.org/2011/02/6/rename-uploaded-files-ascii-character-set-django/ > > I have told the client to use only ascii for the

Re: I need a programmer Python Django

2012-06-14 Thread Carlos Daniel Ruvalcaba Valenzuela
I work with a freelancer group with a focus on django/python clients, we can send you a quote if you can tell us more about this project. Drop me an email to either: clsdan...@gmail.com clsdan...@blackchairsoft.com Regards, Carlos Ruvalcaba Blackchair Software -- You received this message

Re: list of year form

2012-06-14 Thread subtitle indo
Sorry for late response. Thanks kenneth and oscar, it really helps! On Tue, Jun 5, 2012 at 1:05 PM, Oscar Mederos wrote: > On Monday, June 4, 2012, 11:04:58 PM, you wrote: > > > Hi All, > > I want to create list of year select form. > > I know that i can generate the value

Re: I need a programmer Python Django

2012-06-14 Thread Frankline
It would be best if you listed the requirements or at the very least what the app is all about. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

I need a programmer Python Django

2012-06-14 Thread javierlima13
I need a quote for a app Im building using Python on Django framework. thx -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/CFgwRu2ny5cJ. To post to this

trailing slash defeats get_absolute_url

2012-06-14 Thread Mike Dewhirst
My urls are working without a trailing slash but not with one. Django version 1.5, Python 2.7. settings.APPEND_SLASH = True (but there is no difference if it is False) Here is the working part ... http://127.0.0.1:8000/item/search When this search retrieves a list of xitems the urls to

Re: from future url -- argh

2012-06-14 Thread Andre Terra
Ah, here it is: https://docs.djangoproject.com/en/dev/internals/deprecation/#id2 Cheers, AT On Thu, Jun 14, 2012 at 8:54 PM, Andre Terra wrote: > I was having the same problem, but with the development version (that is, > 1.4+, or soon to be 1.5). > > Just remove the {%

Re: from future url -- argh

2012-06-14 Thread Andre Terra
I was having the same problem, but with the development version (that is, 1.4+, or soon to be 1.5). Just remove the {% load url from future %} because the future is NOW! :O The old {% url %} tag has apparently been deprecated, but I can't find any notes on this change after 2 mins of googling.

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread Hendrik Speidel
Hi, as an alternative you can provide your own Storage implementation like outlined here: http://source.mihelac.org/2011/02/6/rename-uploaded-files-ascii-character-set-django/ Note: you may also need to override get_available_name to get it working if i remember correctly. hendrik On

Re: Admin plugins

2012-06-14 Thread Lachlan Musicman
On Thu, Jun 14, 2012 at 1:20 AM, patrickk wrote: > what do you mean with "Grappelli and django-admin-tools are both still being > developed"? > both apps have stable releases for quite a while (with grappelli, this is > even true for a couple of years now). I was looking

from future url -- argh

2012-06-14 Thread JeffH
django 1.4 topapp urls.py ... url(r'^shows/', include('shows.urls')), template base.html ... {% url shows.views.customers %} shows urls.py .. url(r'^customers/$', 'shows.views.customers') The above works just fine -- everything is happy except for the deprecation

Re: RSS Reader

2012-06-14 Thread creecode
Hello armagan, A quick guess. Mozilla's RSS reader doesn't understand your tag and so passes over it and doesn't display it? If the tag isn't part of the RSS specification then a "standard" reader isn't going to do anything with your tag. You

Re: Stuck already on step one, django on windows

2012-06-14 Thread Gerald Klein
If I understand you correctly it just asking you to enter a directory via cli, although you may not have ksh,bash or whatever windows still uses a filesystem. run "cmd" from the start menu run prompt. Then navigate to the directory they are instructing, some simple commands are duplicated between

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread Paulo Almeida
Hi, Have you tried using SetEnv directives in .htaccess to change the locale? I'm not sure how that would interact with wsgi, but maybe something like this: http://drumcoder.co.uk/blog/2010/nov/12/apache-environment-variables-and-mod_wsgi/ Of course you'd have to do it in .htaccess instead of

Re: How I use Django, Virtualenv and Buildout together

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 14:53:11 UTC+1, Andrew Bialecki wrote: > > Hey everyone, > > I wrote a quick blog post on how I use Django with virtualenv and > Buildout. Hope it's helpful: > http://www.sophomoredev.com/2012/06/how-i-use-django-virtualenv-and-buildout-together/ > . > Nice article. If

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread bruno desthuilliers
On Thursday, June 14, 2012 1:58:28 PM UTC+2, lawgon wrote: > > On Thu, 2012-06-14 at 04:19 -0700, bruno desthuilliers wrote: > > > I have an application which runs on a webfaction hosting. > > > > > > > > How is it deployed exactly ? > > apache + wsgi > Ok, so that's the same setup we

Re: Stuck already on step one, django on windows

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 08:24:41 UTC+1, Daniel Patriarca wrote: > > I just installed python, then mysql, then django on my windows 7 machine > and I think it worked because I ran the import django comand from python > and nothing barked at me. I thought. yeah... time to hit the tutorial but

RSS Reader

2012-06-14 Thread armagan
Hi, I wrote a rss custom feed class and I add an item element with 'handler.addQuickElement(u"city", item['city'])' this function. It's ok I can see the city tags in xml but mozilla's rss reader can't read my city tags. What can I do to fix the problem? Thank you for your advice. -- You

How I use Django, Virtualenv and Buildout together

2012-06-14 Thread Andrew Bialecki
Hey everyone, I wrote a quick blog post on how I use Django with virtualenv and Buildout. Hope it's helpful: http://www.sophomoredev.com/2012/06/how-i-use-django-virtualenv-and-buildout-together/. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Paulo Almeida
Hi Alireza, Yes, that did the trick! Thank you, Paulo On Thursday, June 14, 2012 2:26:46 PM UTC+1, Alireza Savand wrote: > > > > On Thursday, June 14, 2012 3:04:54 PM UTC+4, Paulo Almeida wrote: >> >> Hi, >> >> I would like to access the request.user in a ModelAdmin function, so I >> can

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Alireza Savand
And if it's just for logged-in user, you can do like https://gist.github.com/2930287 at the ModelAdmin -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Alireza Savand
On Thursday, June 14, 2012 3:04:54 PM UTC+4, Paulo Almeida wrote: > > Hi, > > I would like to access the request.user in a ModelAdmin function, so I can > filter the results of a query based on the logged in user. I have these > models: > > class Speaker(models.Model): > name =

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Paulo Almeida
Hi again, >From what I read in the 1.4 docs, the SimpleListFilter example is for list_filter and not list_display. To clarify what I wrote before, if a user endorses Speaker A and opposes Speaker B, I want the Speaker list in the admin site to show: |Name | Is endorsed | |A | True

Rss custom feed and add an item eleman

2012-06-14 Thread armagan
Hi, I want to add an item element to my rss. I used below code class CustomFeed(Atom1Feed): def add_item_elements(self, handler, item): super(CustomFeed, self).add_item_elements(handler, item) handler.addQuickElement(u"city", item['city']) And in my rss feed def

Re: csrf protection and testing with tsung

2012-06-14 Thread ashutosh bijoor
Thanks for posting this was exactly what I needed :) On Wednesday, 22 June 2011 14:22:52 UTC+5:30, Ivan Uemlianin wrote: > > Dear Malcom > > Thanks very much for your help! You were exactly right. The > following config works (simplified for exposition). > > Best wishes > > Ivan > >

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Paulo Almeida
Hi Melvyn, I've only been reading the Django 1.2 docs, because it's what's immediately available in my Linux distribution, but that would be an excellent reason to upgrade, if I can get it to work. Thanks, Paulo On Thursday, June 14, 2012 12:33:34 PM UTC+1, Melvyn Sopacua wrote: > > On

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread kenneth gonsalves
On Thu, 2012-06-14 at 04:19 -0700, bruno desthuilliers wrote: > > I have an application which runs on a webfaction hosting. > > > > How is it deployed exactly ? apache + wsgi > (sorry never used webfaction hosting for django - nor for anything > else > FWIW) not my choice, client choice >

Re: Accessing request.user in a ModelAdmin function

2012-06-14 Thread Melvyn Sopacua
On 14-6-2012 13:04, Paulo Almeida wrote: > So then I could just add "is_endorsed" to the list_display variable to have > the endorsement status for that user in the Speaker list, in the Admin > site. Of course, this doesn't work because request isn't available in the > is_endorsed function. I

Re: Stuck already on step one, django on windows

2012-06-14 Thread Melvyn Sopacua
On 14-6-2012 9:24, Daniel Patriarca wrote: > I just installed python, then mysql, then django on my windows 7 machine > and I think it worked because I ran the import django comand from python > and nothing barked at me. I thought. yeah... time to hit the tutorial but > the first thing it

Re: 'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread bruno desthuilliers
On Thursday, June 14, 2012 12:35:40 PM UTC+2, lawgon wrote: > > hi, > > I have an application which runs on a webfaction hosting. How is it deployed exactly ? (sorry never used webfaction hosting for django - nor for anything else FWIW) > I also have > the same app running on my devel

Re: image in browser

2012-06-14 Thread Satvir Toor
On Thu, Jun 14, 2012 at 3:33 PM, kenneth gonsalves wrote: > from the questions you have been asking on the list it seems to me that > you are unfamiliar with web programming. I suggest that you take some > time out to learn the basics of web programming and also to

Re: Django in shared production server

2012-06-14 Thread Melvyn Sopacua
On 13-6-2012 10:28, ruma wrote: > Now I want to deploy in the production. But I do not have access to > the httpd. Use uwsgi deployment, start it up as your own user then remind the people at the service that you're paying them and request a config change to the webserver pointing the hostname

Re: image in browser

2012-06-14 Thread Satvir Toor
> You better show us the template too. Problem solved. Image is displaying just putting the image into the localhost directories(/var/www/logo.png) and giving the src attribute as http://localhost/logo.png; `width="200" height="200" alt="image is not available" align="right"/> -- Satvir Kaur

Re: list_display showing latest creation date of set?

2012-06-14 Thread Bram de Jong
please ignore this email! - bram On Thu, Jun 14, 2012 at 1:07 PM, Bram de Jong wrote: > Hi all, > > I have: > > class A(models.Model) >    created = > > -- > http://www.samplesumo.com > http://www.freesound.org > http://www.smartelectronix.com >

Accessing request.user in a ModelAdmin function

2012-06-14 Thread Paulo Almeida
Hi, I would like to access the request.user in a ModelAdmin function, so I can filter the results of a query based on the logged in user. I have these models: class Speaker(models.Model): name = models.CharField(max_length=50) endorsements = models.ManyToManyField(User,

Re: image in browser

2012-06-14 Thread Ivan Ivanov
На Thu, 14 Jun 2012 14:21:00 +0530 Satvir Toor написа: > > This is a strange thing to want to do. What are you doing with > > `img` in the template? > I am using image_data variable as a image source in the template(html > file). > > > What should i ??? Image is not

Re: image in browser

2012-06-14 Thread Christian Jurk
Why would you do that this way? The usual way would be to put your images into the static files and serve it from there. However, you should be able to do it that way using base64 encoding of the binary data: from base64 import b64encode def my_image(request): image_data =

Stuck already on step one, django on windows

2012-06-14 Thread Daniel Patriarca
I just installed python, then mysql, then django on my windows 7 machine and I think it worked because I ran the import django comand from python and nothing barked at me. I thought. yeah... time to hit the tutorial but the first thing it tells me to do is cd to a directory. Is there a unix

Re: image in browser

2012-06-14 Thread Ivan Ivanov
На Thu, 14 Jun 2012 11:45:19 +0530 Satvir Toor написа: > hello, > > i wish to display the image into the browser through a template . I > used the following code to retrieve the image from Disk and send that > data to Html file > > def my_image(request): >

list_display showing latest creation date of set?

2012-06-14 Thread Bram de Jong
Hi all, I have: class A(models.Model) created = -- http://www.samplesumo.com http://www.freesound.org http://www.smartelectronix.com http://www.musicdsp.org office: +32 (0) 9 335 59 25 mobile: +32 (0) 484 154 730 -- You received this message because you are subscribed to the Google

Re: How can i transmit an objects in list?

2012-06-14 Thread Dominis
> > You are probably getting this error because when you generate your list > from categories. you are adding sub categories as list. so your list will > be like following > > [cat1,cat2,cat3,[subcat1,subcat2],[subcat3,subcat4]] > Yes, mistake was here. Now i solve it with check "if

'ascii' codec can't encode character u'\xe4'

2012-06-14 Thread kenneth gonsalves
hi, I have an application which runs on a webfaction hosting. I also have the same app running on my devel machine. The code in the two machines are pulled from the same repo. Django versions are identical. Python versions are identical. I try to upload a file called Lisäinfo kummeille.pdf in the

Re: image in browser

2012-06-14 Thread kenneth gonsalves
On Thu, 2012-06-14 at 14:21 +0530, Satvir Toor wrote: > > This is a strange thing to want to do. What are you doing with `img` > in the > > template? > I am using image_data variable as a image source in the template(html > file). > > > What should i ??? Image is not displaying. > > from the

field-null or not-null filter?

2012-06-14 Thread Bram de Jong
Hey guys, I was wondering if there is a way of making a field null vs not-null filter without coding it yourself? I tried: list_filter = (('field_which_is_foreign_key', BooleanFieldListFilter),) In the end I wrote this little one: class MyFieldFilter(SimpleListFilter): title = _('

Re: django 1.4 memory issues

2012-06-14 Thread akaariai
On 12 kesä, 17:59, Greg Donald wrote: > Over the weekend I upgraded my project to Django 1.4.  After the > upgrade my Apache/mod_wsgi setup began running out of memory.  I > increased the memory capacity of my virtual servers, but that only > extended the time until they began

Re: How postgres data type "real" is represented in Django?

2012-06-14 Thread akaariai
On 12 kesä, 18:50, IgorS wrote: > Hi ALL! > > It seems that there is no class in Django models that represents 4-byte > data type "real" in postgres. I looked into > django\db\backends\postgresql_psycopg2\creation.py but could not find it > there. The only choice seems to

Re: image in browser

2012-06-14 Thread Satvir Toor
On Thu, Jun 14, 2012 at 2:32 PM, Daniel Roseman wrote: > On Thursday, 14 June 2012 09:51:00 UTC+1, Satvir Kaur wrote: >> >> > This is a strange thing to want to do. What are you doing with `img` in >> > the >> > template? >> I am using image_data variable as a image source

Re: CSRF Issue

2012-06-14 Thread cmac0tt
fixed. thanks mate! On Thursday, June 14, 2012 3:46:24 AM UTC-4, cmac0tt wrote: > > I feel like an idiot here, I've worked my way around this multiple times > but its just not working this time and as you can see ive thrown every > method there is in the documentation at it. > > (note that I am

Re: image in browser

2012-06-14 Thread kooliah
Why don't you use staticfiles? https://docs.djangoproject.com/en/dev/howto/static-files/ On 06/14/2012 08:15 AM, Satvir Toor wrote: hello, i wish to display the image into the browser through a template . I used the following code to retrieve the image from Disk and send that data to Html

Re: CSRF Issue

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 10:00:09 UTC+1, cmac0tt wrote: > > ahem, so here is the view > > from wikicamp.wiki.models import Page > from django.shortcuts import render_to_response > from django.http import HttpResponseRedirect > from django.shortcuts import render > from django.shortcuts import

Re: image in browser

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 09:51:00 UTC+1, Satvir Kaur wrote: > > > This is a strange thing to want to do. What are you doing with `img` in > the > > template? > I am using image_data variable as a image source in the template(html > file). > > > What should i ??? Image is not displaying.

Re: CSRF Issue

2012-06-14 Thread cmac0tt
ahem, so here is the view from wikicamp.wiki.models import Page from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.shortcuts import render from django.shortcuts import redirect from django import forms import htmllib from django.template

Re: CSRF Issue

2012-06-14 Thread cmac0tt
ok, so this is my view now. Maybe I'm not understanding and if so I apologize. We all start somewere right. I just dont know why I'm having trouble with it now when I had it working last time around with simply using C {} On Thursday, June 14, 2012 3:46:24 AM UTC-4, cmac0tt wrote: > > I feel

Re: image in browser

2012-06-14 Thread Satvir Toor
> This is a strange thing to want to do. What are you doing with `img` in the > template? I am using image_data variable as a image source in the template(html file). What should i ??? Image is not displaying. -- Satvir Kaur satveerkaur.blogspot.in -- You received this message because you

[ANN]: FeinCMS v1.6.0

2012-06-14 Thread Matthias Kestenholz
Hello everyone FeinCMS v1.6.0 has been released this noon and is available from usual places. What is FeinCMS anyway? === FeinCMS is one of the most advanced Content Management Systems built on top of Django. FeinCMS not only includes a page module with many bundled content

Re: Dynamic Model Saving and Admin Activation

2012-06-14 Thread Daniel Roseman
On Wednesday, 13 June 2012 21:46:27 UTC+1, Karandeep Nagra wrote: > > So I've set up my Django site to create a dynamic model for every Server > that is created. So at the creation of server Bender, the model > Bender_request is created. But whenever I restart the built-in server, >

Re: CSRF Issue

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 08:46:24 UTC+1, cmac0tt wrote: > > I feel like an idiot here, I've worked my way around this multiple times > but its just not working this time and as you can see ive thrown every > method there is in the documentation at it. > > (note that I am learning python and

Re: image in browser

2012-06-14 Thread Daniel Roseman
On Thursday, 14 June 2012 07:15:19 UTC+1, Satvir Kaur wrote: > > hello, > > i wish to display the image into the browser through a template . I > used the following code to retrieve the image from Disk and send that > data to Html file > > def my_image(request): > image_data =

Re: How can i transmit an objects in list?

2012-06-14 Thread huseyin yilmaz
You are probably getting this error because when you generate your list from categories. you are adding sub categories as list. so your list will be like following [cat1,cat2,cat3,[subcat1,subcat2],[subcat3,subcat4]] I think you want to use list.extend(BuildList(category.childrens.all())) so

Re: Admin plugins

2012-06-14 Thread patrickk
what do you mean with "Grappelli and django-admin-tools are both still being developed"? both apps have stable releases for quite a while (with grappelli, this is even true for a couple of years now). best, patrick Am Donnerstag, 14. Juni 2012 00:33:00 UTC+2 schrieb Lachlan Musicman: > >

CSRF Issue

2012-06-14 Thread cmac0tt
I feel like an idiot here, I've worked my way around this multiple times but its just not working this time and as you can see ive thrown every method there is in the documentation at it. (note that I am learning python and django right now on the fly) however here is my views, the form with

Re: django 1.4 memory issues

2012-06-14 Thread francescortiz
You could create a bug report: https://code.djangoproject.com/newticket On Tuesday, June 12, 2012 4:59:08 PM UTC+2, Greg Donald wrote: > > Over the weekend I upgraded my project to Django 1.4. After the > upgrade my Apache/mod_wsgi setup began running out of memory. I > increased the memory

Re: How can i transmit an objects in list?

2012-06-14 Thread Dominis
> > I suppose that "childrens" is a custom manager, can you show us, the > implementation of that manager? > Childrens it's just a related_items parameter for a field. This code from models.py > class Categories(models.Model): > name = models.CharField(max_length=50) > path =

Re: How can i transmit an objects in list?

2012-06-14 Thread Àlex Pérez
Hello, Are you sure? I suppose that "childrens" is a custom manager, can you show us, the implementation of that manager? Only for performance "if len(category.childrens.all()):" -> "if category.childrens.exist():" But your problem, it's rare. Print the type of the firs element of the result

How can i transmit an objects in list?

2012-06-14 Thread Dominis
Hello. I need a bit help with my code. I write a function for menu building, which should create a list of objects, for designing it in html code. Code of function below: > def BuildList(categories): > list = [] > for category in categories: > if len(category.childrens.all()): >

image in browser

2012-06-14 Thread Satvir Toor
hello, i wish to display the image into the browser through a template . I used the following code to retrieve the image from Disk and send that data to Html file def my_image(request): image_data = open("/home/toor/Desktop/certificate/logo.png", "rb").read() return