Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Hemebond
Oh, and also AJAX requests could then do everything on the object URI (since they won't need the forms). Maybe it could be done with temporary objects in the database. Use a randomised value in the redirect URL to re-fetch what the user typed in and the errors associated, then discard the entry.

Template file not recognized for some strange reason

2012-03-29 Thread Mika
I'm working through one of the template examples in the django book and the template file I created isn't being recognized for some reason even though it's in the folder. The error report is at the bottom of the page. The TEMP_DIRS variable is set to the correct file path in my settings file:

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Hemebond
I can definitely write my code the normal way. I just wanted to see if it was possible; perhaps some way I hadn't thought of. I just liked the idea of all CRUD operations being done on the object URI. On Mar 30, 3:29 am, Mjumbe Poe wrote: > You're correct: HTTP does

Re: Web App Systems Management Tool for Ubuntu Platform

2012-03-29 Thread Alex Mandel
On 03/29/2012 06:37 PM, Eduardo Bergavera wrote: > Hi Everyone! > > I would like to ask some guidance regarding anyone who may be > interested in developing web-based python app for systems management > in Ubuntu. The web-app acts as centralized interface to manage cloud > based or physical

Web App Systems Management Tool for Ubuntu Platform

2012-03-29 Thread Eduardo Bergavera
Hi Everyone! I would like to ask some guidance regarding anyone who may be interested in developing web-based python app for systems management in Ubuntu. The web-app acts as centralized interface to manage cloud based or physical Ubuntu servers in one location. I'd like it to be developed using

Re: Where are the site variables set?

2012-03-29 Thread Mike Dewhirst
On 30/03/2012 10:02am, Robert Steckroth wrote: Hello Gang, I have two other servers on Debian which have the correct site variables set. E.g. site.name , site.domain. But on this particulaly crazy Centos setup the site variable is set to the default (www.example.com

Where are the site variables set?

2012-03-29 Thread Robert Steckroth
Hello Gang, I have two other servers on Debian which have the correct site variables set. E.g. site.name, site.domain. But on this particulaly crazy Centos setup the site variable is set to the default (www.example.com). It shows when I use it in this manner --> {% load i18n %} {% trans "Simply

Re: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:47 AM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman > wrote: >> On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >>> >>> Hi!, >>> I've overrided the save() method of one of my

Re: Problems with {% url %} in templates

2012-03-29 Thread Jamie Lawrence
On Mar 29, 2012, at 12:59 PM, Alasdair Nicol wrote: > Hi Jamie, > Don't include the (.*)$ in the regex for the include. The documented pattern > [1] for the include is > >(r'^d/events/', include('myproject.events.urls')), Ah, thank you, that was it. (I do need sleep - don't know how long

Re: Problems with {% url %} in templates

2012-03-29 Thread Alasdair Nicol
Hi Jamie, On 29/03/12 20:49, Jamie Lawrence wrote: I'm very confused… this has worked fine in the past. Django 1.3.1 In myproject/urls.py: urlpatterns = patterns('', (r'^d/events/(.*)$', include('myproject.events.urls')), […] Don't include the (.*)$ in the regex for the include. The

Problems with {% url %} in templates

2012-03-29 Thread Jamie Lawrence
I'm very confused… this has worked fine in the past. Django 1.3.1 In myproject/urls.py: urlpatterns = patterns('', (r'^d/events/(.*)$', include('myproject.events.urls')), […] in myproject/events/urls.py : urlpatterns = patterns('myproject.events.views', url(r'^add/$', 'add_view',

Re: Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 7:40 PM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 6:28 PM, Marc Aymerich wrote: >> Hi guys, >> I have an application that execute some tasks after an object is >> modifyed through django admin interface. In order to do that

Re: Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 6:28 PM, Marc Aymerich wrote: > Hi guys, > I have an application that execute some tasks after an object is > modifyed through django admin interface. In order to do that I'm > subscribed to django.contrib.admin.models.EntryLog post_save signal > and

Re: Auth app in separate database

2012-03-29 Thread Chris
I setup my router following the docs. Here's what my router.py looks like: AUTH_APPS = ('auth',) class MyRouter(object): def db_for_read(self, model, **hints): if model._meta.app_label in AUTH_APPS: return 'auth' return None def db_for_read(self, model,

Re: comparing custom template tag within if tag

2012-03-29 Thread Nikhil Verma
Hi All I am still not able to solve this problem .Any more suggestions ? Thanks On Thu, Mar 29, 2012 at 10:03 PM, Tom Evans wrote: > On Thu, Mar 29, 2012 at 5:22 PM, Josh Cartmell > wrote: > > I think something like this would work: > > {% with

Re: comparing custom template tag within if tag

2012-03-29 Thread Tom Evans
On Thu, Mar 29, 2012 at 5:22 PM, Josh Cartmell wrote: > I think something like this would work: > {% with price_for_pax service pax '' as pfp %} It won't. The {% with %} tag cannot arbitrarily call custom tags. Cheers Tom -- You received this message because you are

Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
Hi guys, I have an application that execute some tasks after an object is modifyed through django admin interface. In order to do that I'm subscribed to django.contrib.admin.models.EntryLog post_save signal and for each signal I execute a celery task. As you migh know django admin views are

Re: comparing custom template tag within if tag

2012-03-29 Thread Josh Cartmell
I think something like this would work: {% with price_for_pax service pax '' as pfp %} {% if service.price == pfp %} do something {% endif %} {% endwith %} Alternatively if price_for_pax is only used for comparing to service.price you could have it return true or false based on whether whatever

Re: Auth app in separate database

2012-03-29 Thread Josh Cartmell
Couldn't he also just add the router before syncdb and then they would be created in the correct database? Chris take a look at this documentation if you haven't already, it explains routers which tell Django which database to use for a particular query:

Re: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:47 AM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman > wrote: >> On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >>> >>> Hi!, >>> I've overrided the save() method of one of my

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Mjumbe Poe
You're correct: HTTP does not allow you to, say, send POST data along in a 30X (redirect) response [1]. You can redisplay the form at your object's URL, but in order to actually do an HTTP redirect back to the form URL, you'd have to pass the form data along in the URL query string or store it on

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Tom Evans
On Thu, Mar 29, 2012 at 12:49 PM, Hemebond wrote: > I don't see anything on there that deals with transferring an > redirecting with POST data. Is there a particular section that covers > this? > > To be honest, I'm not sure if HTTP really supports what I'm trying to > do, let

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Joel Goldstick
On Thu, Mar 29, 2012 at 7:49 AM, Hemebond wrote: > I don't see anything on there that deals with transferring an > redirecting with POST data. Is there a particular section that covers > this? > > To be honest, I'm not sure if HTTP really supports what I'm trying to > do, let

Re: How Admin can be able to configure Model fields

2012-03-29 Thread Tom Evans
On Thu, Mar 29, 2012 at 2:24 PM, Deepak RK wrote: > Ok , I will follow these guidelines , > Thanks > > I am a newbie in django. > Again I want to come on question : > I did some investigation around  Django admin inbuilt  functionality > for my requirement but I have not found

Re: How Admin can be able to configure Model fields

2012-03-29 Thread Deepak RK
Ok , I will follow these guidelines , Thanks I am a newbie in django. Again I want to come on question : I did some investigation around Django admin inbuilt functionality for my requirement but I have not found yet ? Admin can add another field in any model and it should start appearing in

Re: How Admin can be able to configure Model fields

2012-03-29 Thread Andre Terra
Deepak, Please read through this before posting again: https://code.djangoproject.com/wiki/UsingTheMailingList Cheers, AT On Thu, Mar 29, 2012 at 5:04 AM, Deepak RK wrote: > Admin can add another field in any model (lets say UserProfile ) and > it should start appearing in

Re: is doing text manipulations in django's template faster than doing same in views

2012-03-29 Thread Andre Terra
If you're doing a lot of operations with your data, there's a chance it should be moved to the view. The template should usually be restricted to defining *how* data gets displayed, whereas the view defines *what* your data is. Cheers, AT On Thu, Mar 29, 2012 at 7:30 AM, vijay shanker

is doing text manipulations in django-template fater than doing same in views

2012-03-29 Thread vijay shanker
i have to do basic text manipulations at times .. which is a better way.. to do so in template or return a result only after doing so from views ?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

is doing text manipulations in django's template faster than doing same in views

2012-03-29 Thread vijay shanker
which one is faster or considered better in terms of performance ? -- 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

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Hemebond
I don't see anything on there that deals with transferring an redirecting with POST data. Is there a particular section that covers this? To be honest, I'm not sure if HTTP really supports what I'm trying to do, let alone Django. On Mar 30, 12:32 am, Joel Goldstick

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Joel Goldstick
On Thu, Mar 29, 2012 at 7:13 AM, Hemebond wrote: > What can I pass back to the edit form view that already contains the > values and errors and how? Posting to the edit form view would work > but that would re-process the form. > > On Mar 30, 12:06 am, Joel Goldstick

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Hemebond
What can I pass back to the edit form view that already contains the values and errors and how? Posting to the edit form view would work but that would re-process the form. On Mar 30, 12:06 am, Joel Goldstick wrote: > On Thu, Mar 29, 2012 at 6:33 AM, Hemebond

Re: Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Joel Goldstick
On Thu, Mar 29, 2012 at 6:33 AM, Hemebond wrote: > I want to use the URL of an object (a detail view) as the destination > for CRUD operations. I want it to be able to accept GET, POST and > DELETE requests. > > As part of this, I want the edit form (retrieved by appending

Can I POST edit form to detail view, and redirect back if invalid?

2012-03-29 Thread Hemebond
I want to use the URL of an object (a detail view) as the destination for CRUD operations. I want it to be able to accept GET, POST and DELETE requests. As part of this, I want the edit form (retrieved by appending /edit/ to the object URL) to submit to the object URL. If the form is invalid, I

Re: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman wrote: > On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >> >> Hi!, >> I've overrided the save() method of one of my ModelForms and I'm >> performing a delete of some related objects depending on some form >>

How Admin can be able to configure Model fields

2012-03-29 Thread Deepak RK
Admin can add another field in any model (lets say UserProfile ) and it should start appearing in registration form. Thanks -- 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

Re: strange problem deleting objects

2012-03-29 Thread Daniel Roseman
On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: > > Hi!, > I've overrided the save() method of one of my ModelForms and I'm > performing a delete of some related objects depending on some form > fields values. The thing is I'm getting differents behaviours > dependening on how the

Re: comparing custom template tag within if tag

2012-03-29 Thread Tom Evans
On Wed, Mar 28, 2012 at 4:59 PM, Nikhil Verma wrote: > Hi all > > i have a custom template tag that takes some argument and calculates the > result. > I want to compare that value obtained from that custom tag with another > variable. > > Custom template tag > {%

Re: Tweepy Not Displaying

2012-03-29 Thread Tom Evans
On Wed, Mar 28, 2012 at 11:56 PM, coded kid wrote: > Hi guys, I want to display user’s timeline in my django app but it’s > not working. It only display a white blank page! I’m using Tweepy. > Below are my codes: > > Views.py > > import tweepy > > def tweetstream(request):

Re: Implementing Foreign Key without admin interface

2012-03-29 Thread Sandeep kaur
On Fri, Mar 9, 2012 at 4:31 AM, Ramiro Morales wrote: > On Thu, Mar 8, 2012 at 4:44 PM, Sandeep kaur wrote: >>                        job_no_id = client.job_no >>                        ... >> Am I wrong somewhere?  How should I do this?  Please