Re: escaping metacharacter in url pattern

2011-04-26 Thread Michel30
That is just terrific Raúl, thanks a lot! code I ended up using: url(r'^cgi-bin/DocDB/ ShowDocument','docDB.views.retrieveDocumentVersion') documentid = int(request.GET.get('docid')) version = request.GET.get('version', '') On Apr 21, 4:16 pm, Raúl Cumplido wrote: > sorry copy&past

Re: i am suspicious !

2011-04-26 Thread Tonton
now it 's work def cleanPath(file): path= settings.MEDIA_ROOT+"/here/"+str(file) if default_storage.exists(path): default_storage.delete(path) return "file deleted : "+str(file) si simple ! :o) tonton On Fri, Apr 22, 2011 at 9:59 AM, Tonton wrote: > so how to pass over

Form redisplay in the case of form errors?

2011-04-26 Thread Derek
I have a form that I am expecting will redisplay with errors; it does not do so. Instead, the "print form.errors" statement is reached which does, in fact, show that there are errors. For example: cellphoneThis field is required. What else do I need to do to have the form be redisplayed? Thanks

Re: Form redisplay in the case of form errors?

2011-04-26 Thread Daniel Roseman
On Tuesday, April 26, 2011 10:37:50 AM UTC+1, Derek wrote: > > I have a form that I am expecting will redisplay with errors; it does not > do so. Instead, the "print form.errors" statement is reached which does, in > fact, show that there are errors. For example: > > cellphoneThis field is >

How to write a view that accesses a method over all objects in a given model?

2011-04-26 Thread matt
First post, creating first Django project and having a of an issue I was hoping for some help with! I'm trying to write my own search which takes as input a user's location and returns a list of places (from my db) sorted by proximity. Here's roughly what I've got: in models.py: class Place(mode

Accessing ImageField temporary file to dynamically change upload_to storage path

2011-04-26 Thread Ian Turner
I'm in need of direction to access the temporary file that is stored in memory or on disk from an ImageField/FileField so that I can read it before it gets moved to its final location. The topics I've found all deal with only modifying the storage path based on other fields in a model. My require

Re: Accessing ImageField temporary file to dynamically change upload_to storage path

2011-04-26 Thread Thomas Weholt
I'm also looking for something like this so please post any info you might find on the subject if you don't get the answer in this group. PS! FYI: I think most software writing metadata into a file writes at exif, perhaps xmp or iptc in addition to plain exif, so you only need to check for exif da

Re: Django 1.2 Dropped Sessions when single view contains registration and login authentication

2011-04-26 Thread Ray Cote
- Original Message - > From: "benp" > To: "Django users" > Sent: Monday, April 25, 2011 8:54:15 AM > Subject: Django 1.2 Dropped Sessions when single view contains registration > and login authentication > I've seen other Django developers have the same exact issue with > registering and

Unexpected error

2011-04-26 Thread Czare1
Once for a while I get very strange error. It's listed below. I Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/django/core/handlers/ base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/www/a

fastcgi and new translation

2011-04-26 Thread ScOut3R
Dear List, I have some issues with runfcgi and translations. I'm running the fastcgi processes from runit with this: /usr/local/bin/python /path/to/manage.py runfcgi daemonize=false method=prefork host=127.0.0.1 port=8001 After compiling a new translation file I restart the fcgi processes but I

Re: Unexpected error

2011-04-26 Thread Daniel Roseman
On Tuesday, April 26, 2011 2:32:35 PM UTC+1, Czare1 wrote: > > Once for a while I get very strange error. It's listed below. I > > Traceback (most recent call last): > > File "/usr/local/lib/python2.7/site-packages/django/core/handlers/ > base.py", line 111, in get_response > response = c

Re: Need advice on ecommerce app direction

2011-04-26 Thread shofty
agree with Russ, but i have used the book mentioned and found it excellent. http://www.amazon.com/Beginning-Django-Commerce-James-McGaw/dp/1430225351 not an affiiate link. On Apr 26, 1:23 am, Russell Keith-Magee wrote: > On Tuesday, April 26, 2011, Ernesto Guevara wrote: > > I find for download

Re: Need advice on ecommerce app direction

2011-04-26 Thread william ratcliff
I believe that you can also buy the book (or e-book) directly from Amazon: http://www.apress.com/9781430225355 and I also found it to be an excellent read. Best, William On Tue, Apr 26, 2011 at 10:15 AM, shofty wrote: > agree with Russ, but i have used the

Re: Unexpected error

2011-04-26 Thread Czare1
Thanks for immediate answer. Here is my manager: class PageManager(models.Manager): def active(self): return self.active_with_expired().filter(Q(expire_time__exact=None) | Q(expire_time__gt=datetime.now())) def active_with_expired(self): return self.filter(active=True, sta

Raw SQL within ModelForm.save() in one transaction

2011-04-26 Thread Radim
How can I execute raw SQL in ModelForm.save()? I am using Django 1.3 / Postgresl 8.3 with contrib.admin without TransactionMiddleware. If I use connection.cursor() in ModelForm.save() (called by admin view which is using @transaction.commit_on_success), the cursor is created within a new Postgres s

M2M Ordering in Admin

2011-04-26 Thread br
I am creating an application for displaying decks of slides. Each slide may be in more than one deck. Order of the slides in a deck matters. So, I have a many to many relation. class Slide(BaseModel): """Represents a slide in a slide deck for a display"" class Deck(BaseModel): name =

Re: M2M Ordering in Admin

2011-04-26 Thread br
Just found this: http://pypi.python.org/pypi/django-sortedm2m/0.3.2 It looks awesome. Thanks, Gregor. Going to try it out. Will post back if I have problems. br On Apr 26, 9:06 am, br wrote: > I am creating an application for displaying decks of slides.   Each > slide may be in more than one

Re: ORM help

2011-04-26 Thread Carl Meyer
Hi Daniel, On Apr 22, 5:57 pm, Daniel Gerzo wrote: > I have a following models: > > class Movie(models.Model): >      title = models.CharField(max_length=255) >      year = models.IntegerField(max_length=4) >      rating = models.DecimalField(max_digits=2, decimal_places=1, default=0) > > class R

Re: cx_Oracle error: ImproperlyConfigured

2011-04-26 Thread kamal sharma
Thanks to all for supporting this to fix the issue. So issue is resolved by adding these 2 lines in "app.wsgi" os.environ["LD_LIBRARY_PATH"] = "/opt/app/oracle/products/11.2.0/lib" os.environ["ORACLE_HOME"] = "/opt/app/oracle/products/11.2.0" Thanks again for helping to fix this issue. Its reall

Re: How to write a view that accesses a method over all objects in a given model?

2011-04-26 Thread Alendit
Hi, to access a model in the view, simply import it into you view. Something along the lines: from yourapp.models import Place from django.http import HttpResponse def some_view(request): OBJECT_ID = 1 # put here the id of the object # or give it as a function arg

authentication not working using test client

2011-04-26 Thread Roy Smith
I've got a test case that essentially looks like this: -- from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User class ApiTest(TestCase): def test_login(

Re: {{ STATIC_URL }} and RequestContext()

2011-04-26 Thread Alendit
Hi, static context processor is simply this: return {'STATIC_URL': settings.STATIC_URL} so you can just add it to your context. Regarding your design decision, i'm not sure, why don't you just give the whole object to the context and access its attributes/functions in the template. Would look m

Re: How do I decode a string that it is received by a filter ???

2011-04-26 Thread Alendit
Django docs say to set Apaches locale correctly http://code.djangoproject.com/wiki/django_apache_and_mod_wsgi Would mean to put export LANG='en_US.UTF-8' export LC_ALL='en_US.UTF-8' into /etc/apache2/envvars. -- You received this message because you are subscribed to the Google Groups "Djang

Re: authentication not working using test client

2011-04-26 Thread Roy Smith
I figured it out. When I first set up my settings.py file, I did: AUTHENTICATION_BACKENDS = ( 'socialregistration.auth.FacebookAuth', ) which breaks (well, omits) the default authentication module that client.login() depends on. I needed to do: AUTHENTICATION_BACKENDS = ( 'django.cont

How i connect my PostgreeSQL to a Django?

2011-04-26 Thread Web Lucas
My Django dont make any program because the PostgreeSQL is not connect. Someone help me. Thanks for the answer. Bye -- 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 unsub

Is there a more basic tutorial?

2011-04-26 Thread byront
Hello, I went through the beginners tutorial and am interested in Django. I new to web development altogether and am having trouble finding resources to help me make a very basic but professional looking page. Something similar to this yacht club page http://bhyc.on.ca/ with a banner, menus that c

Re: How i connect my PostgreeSQL to a Django?

2011-04-26 Thread Shawn Milochik
What error are you getting? -- 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 op

Re: Is there a more basic tutorial?

2011-04-26 Thread Shawn Milochik
This has nothing to do with Django. This is a Web design question. Try a mailing list about HTML and/or CSS. Mostly CSS. 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. T

Re: How do I decode a string that it is received by a filter ???

2011-04-26 Thread Oleg Lomaka
I meant to try locally if it solves your problem. If yes, then migrate solution to live server. Anyway, what OS do you use at your apache server? On Mon, Apr 25, 2011 at 9:40 PM, Ariel wrote: > The site is deploy in an apache server, that does not help. > Do you have any other idea ??? > I thoug

User Profile and Form initial values

2011-04-26 Thread James
I'm struggling to create a method by which a user can update his user profile, where the current information is displayed in the "edit" form, and I'm hoping someone here can point out what I'm doing wrong. I am not using ubernostrum's django-profiles for this because it hasn't been touched in quite

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
If you're creating a ModelForm that already has data in the database, don't pass in request.POST. Instead, pass in the instance with the 'instance' keyword argument. For example, if it was a ModelForm for the User object: form = UserForm(instance = request.user) -- You received this messa

Re: Django ORM question about lookups that span relationships

2011-04-26 Thread Carsten Fuchs
First of all, many thanks to everyone who replied in this thread, your posts were very interesting and helpful! On 24.04.2011 07:35, Alexander Schepanovski wrote: You can, with a subrequest: Blog.objects.filter(pk__in=Entry.objects.filter(pub_date__lte=date(2011, 4, 1), headline__contains='Lenn

Re: User Profile and Form initial values

2011-04-26 Thread James
That did it. 99% of the time the data will be there; I can write exception clauses for when it isn't. I think I'll use this method, though I had just discovered the "initial" dictionary argument as well, a few minutes before I noticed your reply. Is there a spot in the Django docs that explains thi

Re: User Profile and Form initial values

2011-04-26 Thread Kenny Meyer
On Tue, Apr 26, 2011 at 4:17 PM, Shawn Milochik wrote: > If you're creating a ModelForm that already has data in the database, don't > pass in request.POST. Instead, pass in the instance with the 'instance' > keyword argument. > > For example, if it was a ModelForm for the User object: form = > Us

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
On 04/26/2011 06:04 PM, Kenny Meyer wrote: On Tue, Apr 26, 2011 at 4:17 PM, Shawn Milochik wrote: If you're creating a ModelForm that already has data in the database, don't pass in request.POST. Instead, pass in the instance with the 'instance' keyword argument. For example, if it was a Model

Re: User Profile and Form initial values

2011-04-26 Thread Shawn Milochik
Yeah, it's documented. Right at the tippy-top of the ModelForms docs. http://docs.djangoproject.com/en/1.3/topics/forms/modelforms/ -- 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

Re: Is there a more basic tutorial?

2011-04-26 Thread Lachlan Musicman
On Wed, Apr 27, 2011 at 04:34, byront wrote: > Hello, > > I went through the beginners tutorial and am interested in Django. I > new to web development altogether and am having trouble finding > resources to help me make a very basic but professional looking page. > Something similar to this yacht

Re: Is there a more basic tutorial?

2011-04-26 Thread Kenneth Gonsalves
On Wed, 2011-04-27 at 10:24 +1000, Lachlan Musicman wrote: > None of these will really help you witha lot of the other stuff you > will need to know - web servers (apache, nginx, lighttpd), CGI, etc. > If you are not a computer scientist or not planning on being one, and > want simple: try wordpres

Django view in admin index.

2011-04-26 Thread kelvinfix
I have a view in view.py: def question_list(request): #questions = Question.objects.filter(topic__icontains = 1) questions = Question.objects.all() return render_to_response('admin/question_list.html', {'questions':questions}) question_list = staff_member_required(question_list) How c

Re: Django view in admin index.

2011-04-26 Thread Oleg Lomaka
Not clearly understand what do you need. If you want to modify Admin index page to add your action links or widgets, take a look at django-grappelli or django-admin-tools. If you want to add custom view for your models, then read this http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django

Re: Unexpected error

2011-04-26 Thread Czare1
The error keeps happening. Here is another trace: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/django/core/handlers/ base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/site

Re: django and fastcgi losing some info in request data

2011-04-26 Thread xiao_haozi
sorry... was doing some more digging. Seems the problem is exclusive to // scenarios. doing somethign like this: http://mydomain/url/http%3A%21%21wikipedia.com/ gives me the proper : http:!!wikipedia.com etc etc so any clue why it would be exclusively stripping out one / from // ? -- You receiv

Experience of migrating a Django site to DotCloud

2011-04-26 Thread Olli Wang
I have migrated my Django site to the new PaaS provider DotCloud. I think it's a pretty good choice if you want to deploy your Django on the cloud. You can see the full article at http://www.ollix.com/blog/2011/04/25/migrating-django-site-dotcloud/ -- You received this message because you are s

Hyperlinks in Messages

2011-04-26 Thread Venkatraman S
Hi, How can i include hyperlinks in the messages?(am using the messages framework). The hyperlinks dont seem to get rendered; am getting the text'd version of the HTML. -Venkat -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: django and fastcgi losing some info in request data

2011-04-26 Thread xiao_haozi
FOUND: http://groups.google.com/group/django-users/msg/76718270ffed9696?pli=1 link for future reference. -- 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

Re: Experience of migrating a Django site to DotCloud

2011-04-26 Thread Venkatraman S
On Wed, Apr 27, 2011 at 10:34 AM, Olli Wang wrote: > I have migrated my Django site to the new PaaS provider DotCloud. I > think it's a pretty good choice if you want to deploy your Django on > the cloud. > > You can see the full article at > http://www.ollix.com/blog/2011/04/25/migrating-django-

How to display the data on the page from the database

2011-04-26 Thread GKR
How to display the data on the page from the database in tabular format like msflexgrid with update facility. Please help -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To u

Re: Experience of migrating a Django site to DotCloud

2011-04-26 Thread Olli Wang
I had tried WebFaction before, but its SSH shell is extremely slow in my country. The first plan (40USD) should allow 3 instances, which means I can assign one for Django site, one for database, and one for a worker to handle time-consuming work. I don't know whether WebFaction is designed for sca