Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread Sam Lai
No, you need that line. It is the first *character* of the file that you need to remove. It is an *invisible* character. Try opening and closing it in notepad; it might remove it. Otherwise, can you get your WSDL generator to not output the BOM? Or, you could use python to read and rewrite that

Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread sami nathan
encoding="UTF-8"?> should i remove this from wsdl file...? and more over i am trying to use my system as server i am refering dive into python chapter 12 introspecting wsdl and searching google i cant find weather its an client side code or server side code but i am in need of server side code do

Re: WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread Sam Lai
How was the WSDL generated? Was it done on a Windows machine? If so, it writes a Byte Order Mark at the start of Unicode documents by default. *nix and Python however doesn't expect BOMs, so it chokes. You need to remove the BOM from your WSDL file. On 27 November 2010 17:46, sami nathan

Re: Caching middleware causes default page caching

2010-11-26 Thread Ashish Gupta
yes, I mistakenly thought I need middleware to cache db objects. I guess following is enough for my needs, CACHE_BACKEND = 'locmem://' from django.core.cache import cache and cache.set('add_key', 'Initial value') >>> cache.add('add_key', 'New value') >>> cache.get('add_key') thanks On Fri,

WEB SERVICE IN DJANGO USING SOAP

2010-11-26 Thread sami nathan
Thanks for notification I am trying to develop web service using django with soap interface i checked my code in python to open wsdl file but its showing error i am sure that wsdl file dosent have any errors this is my code>>> from SOAPpy import WSDL >> server=WSDL.Proxy('D/soap/FlyppSms.wsdl')

Re: Caching middleware causes default page caching

2010-11-26 Thread Christophe Pettus
On Nov 26, 2010, at 8:30 PM, ydjango wrote: > I have added following to cache some common DB data and it seems it > has started caching whole pages by default. Some pages appeared to be > retrieved from cache without even hitting the view. Unless I'm missing something, that's exactly what it is

Caching middleware causes default page caching

2010-11-26 Thread ydjango
I have added following to cache some common DB data and it seems it has started caching whole pages by default. Some pages appeared to be retrieved from cache without even hitting the view. I am using CACHE_BACKEND = 'locmem://' following middleware in following order

Re: remember me in login

2010-11-26 Thread creecode
Hello robos85, On Nov 26, 4:07 pm, robos85 wrote: > Is there any easy way to do remember me trigger during login? For remember me functionality you can try my remember me app at . > I know that there is SESSION_COOKIE_AGE but

Re: newbie: concept question

2010-11-26 Thread Łukasz Rekucki
On 26 November 2010 21:09, Charlietuna wrote: > Hi all, > > I looked for FAQ, but I couldn't find any. Here's my question. I've > been working through the tutorials. I've taken a community college > class on Python. So, I have some background there. > I've gotten Django

Re: remember me in login

2010-11-26 Thread Addy Yeow
i use this http://djangosnippets.org/snippets/1881/ On Sat, Nov 27, 2010 at 8:07 AM, robos85 wrote: > Is there any easy way to do remember me trigger during login? > I know that there is SESSION_COOKIE_AGE but it's set site-wide. Is > there any possibility to set expiration

newbie: concept question

2010-11-26 Thread Charlietuna
Hi all, I looked for FAQ, but I couldn't find any. Here's my question. I've been working through the tutorials. I've taken a community college class on Python. So, I have some background there. I've gotten Django installed and working. So far, I've used sqlite3. Here's the question: If you have

remember me in login

2010-11-26 Thread robos85
Is there any easy way to do remember me trigger during login? I know that there is SESSION_COOKIE_AGE but it's set site-wide. Is there any possibility to set expiration at browser close or x time? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Askani

2010-11-26 Thread Wim Feijen
Nice! It definitely saves typing. Sounds like a right thing for newbies, because when I was a newbie, I always had to look up which fieldname to use and oh the typos. Wim On Nov 20, 3:28 pm, Alvaro Mouriño wrote: > Hi. > > I'd like to introduce to you this idea I've been

Re: Reusing actions "Save and continue editing" and "Save"

2010-11-26 Thread Wim Feijen
Hi Lom, I would recommend the following: 1. Add all three buttons to your template 2. In your view, handle the form saving and then determine which button has been pressed. 3. Accordingly, redirect to the same url (for example, redirect("/ address/14") for viewing, redirect("/address/14/edit")

Re: Building Privacy Options Like Facebook with Django

2010-11-26 Thread Wim Feijen
Hi Corey, I would recommend using a UserProfile for this, which is bound to a user (so make sure an authenticated user can access only his profile by using request.user.get_profile() in your views. See: http://docs.djangoproject.com/en/dev/topics/auth/ Good luck! Best regards, Wim On Nov 25,

Re: Central Login with Redirecting users based on Groups

2010-11-26 Thread Wim Feijen
In addition, you can use permissions to deny access for users to certain views by using the permission_required decorator, see: http://docs.djangoproject.com/en/dev/topics/auth/ Wim On Nov 25, 4:46 pm, Knut Ivar Nesheim wrote: > Hi Stefan, > > If you roll your own login view,

Re: extends a template that is stored in an app template directory

2010-11-26 Thread Wim Feijen
Hi Owidjaya, Common usage is to refer to your_app_name/template_name.html , so you can put for example {% extends "datagrid/template1.html" %} in your client template. So it is recommended to store your templates in a directory your_app_name/templates/your_app_name/template_name.html For more

Re: Models not being updated when accessed by multiple processes

2010-11-26 Thread Iqbal Abdullah
After a bit more of searching I've finally figured out what I wanted is "atomic updates". Using the F() expression seems to be the best solution without much code overhaul: http://stackoverflow.com/questions/280075/atomic-operations-in-django

Re: how to do Query profiling of views called from AJAX calls?

2010-11-26 Thread Matteius
Have you tried using Firebug Firefox Add-on? On Nov 25, 3:46 pm, ydjango wrote: > Django debug and django debug tool bar are not capturing the django > ORM calls made from the views which are called via AJAX calls in the > page . Is there any way to profile these sqls and

Re: Caught UnicodeDecodeError when using {% get_available_languages as langs %}

2010-11-26 Thread Federico Capoano
Thanks Tom. On Nov 26, 9:15 pm, Tom Evans wrote: > On Fri, Nov 26, 2010 at 7:46 PM, Federico Capoano > > > > > > > > > > wrote: > > Hi all, > > > this is my settings.py > > > _ = lambda s: s > > > LANGUAGES = ( > >  ('en', _('English')), > >

Re: Caught UnicodeDecodeError when using {% get_available_languages as langs %}

2010-11-26 Thread Tom Evans
On Fri, Nov 26, 2010 at 7:46 PM, Federico Capoano wrote: > Hi all, > > this is my settings.py > > _ = lambda s: s > > LANGUAGES = ( >  ('en', _('English')), >  ('es', _('Español')), >  ('it', _('Italiano')), > ) > > When I use {% get_available_languages as langs %} > > I

Re: Caught UnicodeDecodeError when using {% get_available_languages as langs %}

2010-11-26 Thread Federico Capoano
1.3 alpha 1 SVN-14688 On Nov 26, 8:46 pm, Federico Capoano wrote: > Hi all, > > this is my settings.py > > _ = lambda s: s > > LANGUAGES = ( >   ('en', _('English')), >   ('es', _('Español')), >   ('it', _('Italiano')), > ) > > When I use {% get_available_languages as

Caught UnicodeDecodeError when using {% get_available_languages as langs %}

2010-11-26 Thread Federico Capoano
Hi all, this is my settings.py _ = lambda s: s LANGUAGES = ( ('en', _('English')), ('es', _('Español')), ('it', _('Italiano')), ) When I use {% get_available_languages as langs %} I get this error: TemplateSyntaxError at / Caught UnicodeDecodeError while rendering: 'ascii' codec can't

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
@Steve, very well. I concede. It's just that it was not the first time I thought he could be more respectful in his approach. He has acknowledged and apologised for this type of behaviour previously. My concern is that those types of unhelpful responses could lead to newcomers feeling that this

Re: PIL issue opening an image file

2010-11-26 Thread Steve Holden
On 11/26/2010 9:58 AM, Sithembewena Lloyd Dube wrote: > Thanks for breaking this down, Tom. I'll play around with it and see if > I'm grasping this. For the record, while it might have seemed to you that Bruno was being "snooty", in fact he was probably (I have no direct evidence) simply

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Kate, that was... On Fri, Nov 26, 2010 at 9:07 PM, Sithembewena Lloyd Dube wrote: > So, I am making headway. Thanks to the gentlemen who nudged me onto the > right path. > > Quick word to Bruno Desthuilliers: while I appreciate that you have greater > experience and might find

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
So, I am making headway. Thanks to the gentlemen who nudged me onto the right path. Quick word to Bruno Desthuilliers: while I appreciate that you have greater experience and might find others' endeavours ridiculous, you could be more helpful and respectful in your tone. Do you see a difference

Re: Accessing multiple databases from a single django app?

2010-11-26 Thread Tom Evans
On Fri, Nov 26, 2010 at 5:28 PM, Roy Smith wrote: > I want my application to be able to access two different mysql > databases (with different credentials, running on two different > servers).  One is a large data collection which I'll be accessing read- > only.  The other is

extends a template that is stored in an app template directory

2010-11-26 Thread owidjaya
How do i extends a template that is stored within an application template directory from another application? I have two apps one is datagrid and the other one is client I want to use datagrid to display list of clients but instead of using the datagrid template that comes from the app, i want to

Accessing multiple databases from a single django app?

2010-11-26 Thread Roy Smith
I want my application to be able to access two different mysql databases (with different credentials, running on two different servers). One is a large data collection which I'll be accessing read- only. The other is read-write, and will be the one which manages the site (account creation, user

Re: Dynamic db_table change

2010-11-26 Thread Tom Evans
On Fri, Nov 26, 2010 at 4:33 PM, Sebastien Ramage wrote: > > >> First off, this is a stupid database design. Do you really create new >> tables in your DB each time you add a user? Mental. > > yes you're right and what I said was just a example ;) > In the real app,

Re: Dynamic db_table change

2010-11-26 Thread Sebastien Ramage
> First off, this is a stupid database design. Do you really create new > tables in your DB each time you add a user? Mental. yes you're right and what I said was just a example ;) In the real app, there's no per user table but per company the database is used by many different companies and

Re: Dynamic db_table change

2010-11-26 Thread Daniel Roseman
On Nov 26, 2:34 pm, Seb wrote: > Hi all ! > > I want to use Django on an existing database where every user have his > own table. > Any idea ? Yes: don't do this. Really, really, don't do this. There's absolutely no reason for each user to have their own table. It

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Thanks for breaking this down, Tom. I'll play around with it and see if I'm grasping this. Regards, Lloyd On Fri, Nov 26, 2010 at 5:55 PM, Tom Evans wrote: > On Fri, Nov 26, 2010 at 3:44 PM, Sithembewena Lloyd Dube > wrote: > > Thanks Daniel, makes

Re: PIL issue opening an image file

2010-11-26 Thread Tom Evans
On Fri, Nov 26, 2010 at 3:44 PM, Sithembewena Lloyd Dube wrote: > Thanks Daniel, makes sense. I gather that what Bruno meant to say on his > soapbox was that the file is in the HTTP request object and can/ should not > be accessible from the hard disk? > > I was familiar with

Re: Key 'buscar' not found in "

2010-11-26 Thread bvcelari
Thanks for the answers, @Nick, but the issue is if add the hidden value buscar, I must add all the parameters used in the search form (quite long), I'm looking for a lazy way doing it. @Rodrigo, same issue, if there is no search parameters, I can't apply my filters to the model, so I will not be

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Thanks Daniel, makes sense. I gather that what Bruno meant to say on his soapbox was that the file is in the HTTP request object and can/ should not be accessible from the hard disk? I was familiar with that, as the file upload dialogue does the job of reading the file off the disk and into

Re: Dynamic db_table change

2010-11-26 Thread Tom Evans
On Fri, Nov 26, 2010 at 2:34 PM, Seb wrote: > Hi all ! > > I want to use Django on an existing database where every user have his > own table. > I want to be able to define one "generic" model for every user and > choose db_table at runtime > there is "table_a" and

Re: PIL issue opening an image file

2010-11-26 Thread Daniel Roseman
On Nov 26, 3:16 pm, Sithembewena Lloyd Dube wrote: > Bruno, the file being uploaded has nothing to do with the deployment server. > When you edit your Google profile to change your avatar, does the file > upload dialogue browse a Google server? No. But that has nothing

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Bruno, the file being uploaded has nothing to do with the deployment server. When you edit your Google profile to change your avatar, does the file upload dialogue browse a Google server? On Fri, Nov 26, 2010 at 4:50 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On 26

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Thanks for nothing. On Fri, Nov 26, 2010 at 4:52 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > On 26 nov, 15:33, Sithembewena Lloyd Dube wrote: > > Thanks Daniel, > > > > Using photo.path causes it to try to find the image in my MEDIA_ROOT, > which > > is

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Well, Bruno, if I knew exactly how to solve this I wouldn't be sitting here taking your snooty remarks, would I? I am asking because I do not know how to go about it. On Fri, Nov 26, 2010 at 4:50 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On 26 nov, 15:03, Sithembewena

Dynamic db_table change

2010-11-26 Thread Seb
Hi all ! I want to use Django on an existing database where every user have his own table. I want to be able to define one "generic" model for every user and choose db_table at runtime there is "table_a" and "table_b" which is a sub-table of "table_a" Database looks like this : For user "100" I

Re: Key 'buscar' not found in "

2010-11-26 Thread Rodrigo "OreiA" Chacon
The most secure way to retrieve a parameter is to use the get method of the QueryDict. So, instead of: request.GET['buscar'] do: request.GET.get('buscar', 'default_value') Or check if the key exists in the QueryDict instance before trying to retrieve it, with: if 'buscar' in request.GET:

ModelForm + MultiValueField = form.save() problem

2010-11-26 Thread Dr.Bleedjent
Hi! I have a modelForm for some model. Example Article: class Article(models.Model) title = models.CharField(max_length=255) price = models.IntegerField() currency = models.IntegerField() class ArticleForm(forms.ModelForm) price = MyPriceFied(choices = CURRENCY_CHOICES)

Re: PIL issue opening an image file

2010-11-26 Thread bruno desthuilliers
On 26 nov, 15:33, Sithembewena Lloyd Dube wrote: > Thanks Daniel, > > Using photo.path causes it to try to find the image in my MEDIA_ROOT, which > is not what I need. Yes it is. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: PIL issue opening an image file

2010-11-26 Thread bruno desthuilliers
On 26 nov, 15:03, Sithembewena Lloyd Dube wrote: > I found the issue: it is the path to the image. When I change the problem > line to > > image = Image.open(os.path.realpath('C:\Users\Lloyd\Desktop\Lloyd.png')) > > it works, Well, kinda... accidentally... > but I cannot

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
If I was handling the photo in a view, I'm sure I could get the path information out of request.FILES['filename'] - but I am trying to upload it in a model. Regards, Lloyd On Fri, Nov 26, 2010 at 4:33 PM, Sithembewena Lloyd Dube wrote: > Thanks Daniel, > > Using photo.path

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Thanks Daniel, Using photo.path causes it to try to find the image in my MEDIA_ROOT, which is not what I need. I need a way to get the path from the image upload dialogue as encircled in the attached image. The image is currently on my desktop and not in my media root and I need to get the

Re: PIL issue opening an image file

2010-11-26 Thread Daniel Roseman
On Nov 26, 2:03 pm, Sithembewena Lloyd Dube wrote: > I found the issue: it is the path to the image. When I change the problem > line to > > image = Image.open(os.path.realpath('C:\Users\Lloyd\Desktop\Lloyd.png')) > > it works, but I cannot hard code the path and I cannot

Re: PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
I found the issue: it is the path to the image. When I change the problem line to image = Image.open(os.path.realpath('C:\Users\Lloyd\Desktop\Lloyd.png')) it works, but I cannot hard code the path and I cannot predict where the user will try to upload a file from. Isn't there a way to

PIL issue opening an image file

2010-11-26 Thread Sithembewena Lloyd Dube
Hi all, I have a Photo model which should take an image, generate a thumbnail and save both the original and the thumbnail images. I registered the model in the admin site, but when I select an image to upload and click 'Save', I get an error as follows: Request Method: POST Request URL:

Re: tree data structure

2010-11-26 Thread bruno desthuilliers
On 25 nov, 16:07, pa_ree wrote: > the idea is basically that there are people in an organization who are > working in various projects under different roles. > so i want to represent the project hierarchy in the form of an > inverted tree structure. You're talking about

Re: confirm user by ref_has and email

2010-11-26 Thread bruno desthuilliers
On 25 nov, 15:11, robos85 wrote: > Yes it looks that: > from django.db import models > from django.contrib.auth.models import User > > class UserProfile(models.Model): >     user = models.ForeignKey(User, unique=True) >     register_hash = models.CharField(max_length=32) > >

Re: Removing title from each admin page

2010-11-26 Thread Marcos Moyano
Sure there is. You have to override the template: django/contrib/admin/templates/admin/base.html Create an admin folder within your templates folder, copy that template over that admin folder and remove the "{{ title }}" statement. Hope it helps. Marcos On Fri, Nov 26, 2010 at 7:37 AM, Luca

Removing title from each admin page

2010-11-26 Thread Luca Casagrande
Hello folks, is there any way to remove the title over each admin element, like "Site administration" or "Select..to change". Thanks Luca -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django feeds sometimes generate AttributeError: 'LatestStripsByStripConfig' object has no attribute '__name __'

2010-11-26 Thread Łukasz Rekucki
On 26 November 2010 10:35, marty3d wrote: > I have disabled cache and still getting the error. That > leaves...what? :/ > > I could really appreciate some help debugging this. On a closer look, this looks like: http://code.djangoproject.com/ticket/13842 ; But then,

Re: Django feeds sometimes generate AttributeError: 'LatestStripsByStripConfig' object has no attribute '__name __'

2010-11-26 Thread marty3d
I have disabled cache and still getting the error. That leaves...what? :/ I could really appreciate some help debugging this. Thank you, /Martin On Nov 25, 10:06 pm, marty3d wrote: > It's 1.2.3. I have two ideas, either it could be the cache (started > using

Re: Custom Login using model form

2010-11-26 Thread Daniel Roseman
On Nov 26, 8:00 am, PRANAV HEGDE wrote: > Hi Daniel, > > Yeah I had a thought like that. I thought I could leave the validation > to the model. > Turns out model form comes handy only if your modifying or updating > something in the database, as you said. > Simple form

Re: Custom Login using model form

2010-11-26 Thread PRANAV HEGDE
On Nov 26, 1:57 am, Daniel Roseman wrote: > On Nov 25, 7:53 am, PRANAV HEGDE wrote: > > > > > > > > > > > Hi guys, > > > I'm trying to create a login form using a model form, > > > user model: > > class users(models.Model): > >     username =