Re: SOAPLIB issue with django upgrade

2009-08-29 Thread Maksymus007
On Sat, Aug 29, 2009 at 5:40 AM, Wombatpm wrote: > > For the record.  SOAPLIB 0.8.1 has a bug in generating the WSDL file > for Arrays. > >> >> - >> >> > name="string"/> >> >> > > the type declaration should be type="xs:string" > > > The unicode issue is being raised by lxml inside of soaplib.

Re: create a link from an object - template tag or?

2009-08-29 Thread MIL
Hi Karen, thank you for your help :o) I did it like this: @register.simple_tag def create_a_link_to(object): # {% create_a_link_to object %} model_name = object.get_model_name() linktext = object.get_linktext() url = object.get_absolute_url() if model_name

Re: how to set field value of a form object before render it?

2009-08-29 Thread hao he
thanks for your reply。 yes,i want to display the form again with some field being modified. how to set the new value to a field of fhe old form to render ? for example : in site signup case. when there are some errors, we hope to display the signup again ,but the password field would been cleare

Loose username policy

2009-08-29 Thread Léon Dignòn
Hello, I don't find a way to allow additional characters in the username: -'[] {}[]… Sure, I could override the user model, but then my 3rd-party- application won't work anymore. (django-profiles/registration). Any ideas? --~--~-~--~~~---~--~~ You received this m

Re: SOAPLIB issue with django upgrade

2009-08-29 Thread Maksymus007
On Sat, Aug 29, 2009 at 10:33 AM, Maksymus007 wrote: > On Sat, Aug 29, 2009 at 5:40 AM, Wombatpm wrote: >> >> For the record.  SOAPLIB 0.8.1 has a bug in generating the WSDL file >> for Arrays. >> >>> >>> - >>> >>> >> name="string"/> >>> >>> >> >> the type declaration should be type="xs:string

Re: Database connection closed after each request?

2009-08-29 Thread Mike
Hi, I made some small custom psycopg2 backend that implements persistent connection using global variable. With this I was able to improve the amount of requests per second from 350 to 1600 (on very simple page with few selects) Just save it in the file called base.py in any directory (e.g. postg

Re: how to set field value of a form object before render it?

2009-08-29 Thread Karen Tracey
2009/8/29 hao he > thanks for your reply。 > > yes,i want to display the form again with some field being modified. > > how to set the new value to a field of fhe old form to render ? > > for example : > in site signup case. > when there are some errors, we hope to display the signup again ,but th

Unsubscribe

2009-08-29 Thread Andrew Holt
Hi, Sorry the the FAQ, but how do I unsubscribe from this group ? I have sent mail, as per the instructions, I have gone to google groups and django is not listed, and still I am getting mail. Thanks, Andrew = Andrew Holt Email: andrew.h...@4asolutions.co.uk De

Re: how to set field value of a form object before render it?

2009-08-29 Thread conrad
I believe you can do the following: if request.method == "POST": form = MyForm(request.POST) c = form.data["a"] + form.data["b"] form.fields["c"].initial = c return render_to_response(template_name , {"form": form}) assuming the initial attribute makes sense for the 'c'

Re: Custom User Model and the Django Admin Site

2009-08-29 Thread Bryan
Thanks for your help. Perhaps I should have been more clear and included more information, because that is exactly what I was asking about. I was hoping that someone had already solved this problem and could fill me in on how they got it working. Btw, my first post was written in pieces while d

Re: Unsubscribe

2009-08-29 Thread Gabriel Gunderson
On Sat, Aug 29, 2009 at 8:04 AM, Andrew Holt wrote: > Sorry the the FAQ, but how do I unsubscribe from this group ? http://groups.google.com/group/django-users/subscribe There is an unsubscribe button in the bottom right of the page. Gabe --~--~-~--~~~---~--~~ Y

Re: need help: unique_together in both directions

2009-08-29 Thread ckar...@googlemail.com
Really no ideas? Chris On 25 Aug., 21:25, "ckar...@googlemail.com" wrote: > Hi, > > first, my models: > > class Connection(models.Model): >     p1 = models.ForeignKey(SinglePoint, related_name='p1_set', > help_text="Punkt 1") >     p2 = models.ForeignKey(SinglePoint, related_name='p2_set', > he

template url tag issue

2009-08-29 Thread selcukcihan
(Django release 1.1) Hi, i have an application within my project, call it app1. It has urls.py within its directory. That project.app1.urls does not get included within ROOT_URLCONF(which points to 'project.urls'). I needed project.app1.urls be isolated from other urls. Then i wrote a middleware i

Re: Template Inheritance - best solution

2009-08-29 Thread haraldthi
On 29 Aug, 06:17, eeyore wrote: > I am working on an app that currently has two main base templates. > > What I would like to do is to avoid having multiple base templates and > having duplicated code withing my templates. > > For example I might have navigation include in the base template, bu

interaction of django with paypal

2009-08-29 Thread orschiro
Hello guys, I've set up a Single-Pay-Button via Paypal. After a customer had paid successfully I configured Paypal to redirect the user to download.domain.tld. There he has to fill in his personal data into a html form and then receive some download data. Well and that is also the problem with m

Re: need help: unique_together in both directions

2009-08-29 Thread Matthias Kestenholz
On Sat, Aug 29, 2009 at 7:51 PM, ckar...@googlemail.com wrote: > > Really no ideas? > > Chris > Is there any way you could define a stable ordering for the SinglePoint model? You could ensure that the "smaller" SinglePoint gets stored in p1 and the "bigger" SinglePoint in p2 in a custom save meth

cache.set could be more functional

2009-08-29 Thread Chris McCormick
Hi *, I always find myself using this idiom: cache.get(key, set_cached(key, KeyValue.objects.get(user=request.user, key=key))) Which basically sets the key upon fetching it. It requires me to define set_cached to be something like this though: def set_cached(key, value): """ Functiona

Re: Loose username policy

2009-08-29 Thread Léon Dignòn
Solution: forms.py from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.utils.translation import ugettext as _ # Overrides django.contrib.auth.forms.UserCreationForm and changes #

Re: Template Inheritance - best solution

2009-08-29 Thread Devang Modi
You can include navigation base template code under djnago block and in your template make that block empty. example: base.html {% block navigation %} some code {% endblock navigtion%} child.html {% extends "base.html %} {% block navigation %}{% endblock navigation %} -Devang. On 8/29/09, ha

Re: interaction of django with paypal

2009-08-29 Thread Devang Modi
Hi, can you implement something like below? if (None == request.META.get('HTTP_REFERER')): return HttpResponseRedirect(reverse(YOUR VIEW FUNCTION THAT REDIRECT TO DOWNLOAD URL)) elif (-1 == request.META.get('HTTP_REFERER') .find(reverse(YOUR VIEW FUNCTION THAT RED

Re: ImageField width_wield

2009-08-29 Thread Léon Dignòn
No, everything is fine. Once you uploaded a file, you can call image.width and image.height (where image is an instance of Image). If you are using ModelForms, you can set editable=False as a parameter for width and height. image = models.ImageField(upload_to='images', height_field='hei

Re: Django and SSL Deployment using mod_wsgi

2009-08-29 Thread Alex Robbins
You'll probably want to look into something like this: http://www.djangosnippets.org/snippets/880/ It allows you to set some urls to redirect so they are always https. Otherwise those silly users will go to credit card pages without https. On Aug 29, 1:04 am, Vitaly Babiy wrote: > Hey guys, > W

Store ImageField file using id as filename

2009-08-29 Thread gon...@gmail.com
I'm trying to store images using the admin interface with the id as the filename. class ProductImage(models.Model): image = ImageField(upload_to=get_path) def get_path(self, filename): return 'product_images/%s.jpg' % self.id However, the images get stored as 'product_images/Non

Django 1.0.2 + CSS how to?

2009-08-29 Thread adelaide_mike
As a very newbie I am struggling to understand how to use CSS. I read in http://docs.djangoproject.com/en/dev/topics/forms/media/#paths-in-media-definitions that I need to write: class Media: css = { 'screen': ('pretty.css',), 'print': ('newspaper.css',) } for examp

Re: Django 1.0.2 + CSS how to?

2009-08-29 Thread Mike Ramirez
On Saturday 29 August 2009 04:35:11 pm adelaide_mike wrote: > As a very newbie I am struggling to understand how to use CSS. I read > in > > http://docs.djangoproject.com/en/dev/topics/forms/media/#paths-in-media-def >initions > > that I need to write: > class Media: > css = { > 's

Re: Store ImageField file using id as filename

2009-08-29 Thread Mike Ramirez
On Saturday 29 August 2009 04:03:58 pm gon...@gmail.com wrote: > I'm trying to store images using the admin interface with the id as > the filename. > > class ProductImage(models.Model): > image = ImageField(upload_to=get_path) > > def get_path(self, filename): > return 'product_ima

Advice on Subclassing a TextField

2009-08-29 Thread Mark Anderson
Hello, I wanted a field that would render in a rich text editor and store the data in a TextField so I created a field type of HtmlField and custom HtmlWidge. It works but I was wondering is anyone would be willing to give me feedback on best practices etc, This is my first attempt at subclassing

Re: Advice on Subclassing a TextField

2009-08-29 Thread Alex Gaynor
On Sun, Aug 30, 2009 at 1:53 AM, Mark Anderson wrote: > Hello, > > I wanted a field that would render in a rich text editor and store the data > in a TextField so I created a field type of HtmlField and custom HtmlWidge. > It works but I was wondering is anyone would be willing to give me feedback