Re: Form Validation - Redisplay With Error

2011-05-24 Thread Robin
Apologies...it seems I misunderstood clean_message(). It's not a method, but clean_* is something for each field. I'll continue my research, but would still love to hear from you all about custom login forms and how you handle them. On May 24, 8:48 pm, Robin wrote: > I'm

Form Validation - Redisplay With Error

2011-05-24 Thread Robin
I'm writing a basic login form using the Django built in authentication system, but my own login form. This may be a mistake, but it can't hurt to learn how to get it to work? :) I have this Django Form: class SignInForm(forms.Form): username = forms.CharField(label='User Name',

Re: Weird problem with rendering a Variable in a custom tag

2011-05-24 Thread stevedegrace
And you are absolutely correct, using a local variable in the render method and not rebinding self,ip resolves the problem. Thank you very much. Can you explain why this is? On May 23, 5:34 am, bruno desthuilliers wrote: > On May 23, 5:37 am, stevedegrace

Re: Weird problem with rendering a Variable in a custom tag

2011-05-24 Thread stevedegrace
Thanks for the advice. I'm actually using this tag on a private moderation page to quickly satisfy my curiosity about which countries generate the most spam in my comments (FYI: Russia is winning hands down so far). On May 23, 10:24 am, Brice Leroy wrote: > Be careful will

Re: Django Newbie Question (Exception Type: TypeError, Value: argument of type 'NoneType' is not iterable)

2011-05-24 Thread Alexandra
Ok I actually just figured it out. My issue was that I was calling the function instead of the actual instance of the form. I got confused because the variables were named almost identically. On May 24, 8:27 pm, Alexandra wrote: > Hi All, > > I am somewhat new to Django,

Limit admin login domain?

2011-05-24 Thread λq
Hi guys, Can I limit only a certain domain can login into django admin? Without running multiple django instances. Is it possible? 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 Newbie Question (Exception Type: TypeError, Value: argument of type 'NoneType' is not iterable)

2011-05-24 Thread Alexandra
Hi All, I am somewhat new to Django, although I have been programming in Python for a while. I installed Pinax and have been working on a site from one of the starter templates, and have an error I can't seem to wrap my head around. Exception Type: TypeError at /models/add Exception Value:

Re: CRUD Tutorial

2011-05-24 Thread Boštjan Mejak
I created a wiki in Django. I can send you the source if you're interested. -- 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: Dynamic Forms

2011-05-24 Thread Rafael Machado
Afshin, recently i came across the same problem. This page helped me to figure out how to do dynamic forms: http://jacobian.org/writing/dynamic-form-generation/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Synchronize method or model field access

2011-05-24 Thread Etam
Hi, how do you synchronize a method (or model field access) in Django? It doesn't work: from multiprocessing import Lock change_status_lock = Lock() def change_status(self, status): self.change_status_lock.acquire() ... self.change_status_lock.release() Thanks in advance, Etam. --

login with subdomains

2011-05-24 Thread tom
Hello, I have a application, where I want that users log in to a special subdomain. For example: The login screen is served at www.agileamp.com and the user is member of the account with subdomain test.agileamp.com. When the user logs in at www.agileamp.com/login/ I want to make sure, that he

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
We all have our opinions. Either way this conversation is OT from Django. On Tue, May 24, 2011 at 4:07 PM, Masklinn wrote: > On 2011-05-24, at 21:57 , Brian Bouterse wrote: > > +1 for xpath > > > > I also like using > >

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Masklinn
On 2011-05-24, at 21:57 , Brian Bouterse wrote: > +1 for xpath > > I also like using > xml.dom.minidomsince > it is so simple and straightforward. > I'm sorry, but I whole-heartedly disagree with this. ElementTree is orders of magnitude

Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread Simon Connah
On 24 May 2011, at 18:49, AJ wrote: > Simon, > > Can you please give details of plugins that you use for Python/Django in > MacVim? > > Thanks, > AJ Sure. I use this plugin collection: https://github.com/carlhuda/janus as well as this extra plugin:

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Brian Bouterse
+1 for xpath I also like using xml.dom.minidomsince it is so simple and straightforward. If you XML is poorly formed go with beautiful soup . Brian 2011/5/24 Тимур Зарипов

TabularInline - getting rid of 'original' row

2011-05-24 Thread candlerb
I've built the 'tutorial' poll application under Django 1.3. One thing I notice is that when viewing the choices shown inline under the poll, each choice has an extra heading piece of text. For example, I could see Choices Not much [Not much ] [0] The Sky [The Sky ]

Re: Dynamic Forms

2011-05-24 Thread Ovnicraft
On Tue, May 24, 2011 at 12:47 PM, Afshin Moshrefi wrote: > I want to write a form which can dynamically add fields. I can simply > add additional fields that I need with JavaScript but am not sure if > that is the best way to handle this with Django? > > What are the

Re: Logging SQL queries

2011-05-24 Thread Shawn Milochik
On 05/24/2011 03:25 PM, candlerb wrote: Thank you. I tried this and it still didn't log my SQL queries. Then I went through the documentation again, and found that I should have configured "django.db.backends" instead of "django.db.backend". It's working now. Sorry for the noise - it would have

Re: Logging SQL queries

2011-05-24 Thread candlerb
On May 24, 5:28 pm, Shawn Milochik wrote: > Here's a handler: ... > Here's a logger: Thank you. I tried this and it still didn't log my SQL queries. Then I went through the documentation again, and found that I should have configured "django.db.backends" instead of

Re: CRUD Tutorial

2011-05-24 Thread Shawn Milochik
On 05/24/2011 02:38 PM, Mike Wisniewski wrote: Yup, that is correct. I'm starting to pull my hair out because I can't find a decent one. Most of them that I've seen either use the generic view or don't really go into explanation. There are also lots of tutorials, many of them use the admin

Re: UK-based Django Host?

2011-05-24 Thread Nan
Thanks, Matt. Normally I'd agree with you, but this application isn't just a website -- it's sensitive to latency issues and will be integrating with a third-party service that's also UK-based, so we're looking at minimizing cross-Atlantic round-trips. On May 24, 2:46 pm, shofty

Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread shofty
why not use a python ide that is html aware? pycharm by jetbrains is good. On May 24, 6:49 pm, AJ wrote: > Simon, > > Can you please give details of plugins that you use for Python/Django in > MacVim? > > Thanks, > AJ > > On Tue, May 24, 2011 at 12:51 PM, Simon Connah >

Re: UK-based Django Host?

2011-05-24 Thread shofty
just use webfaction, you dont know that they're US when you connect from the UK, speed isnt an issue. I moved to a VPS for cost reasons, but webfaction were fine for me. Matt On May 24, 6:03 pm, Nan wrote: > I know this question has been asked before, but the most recent

Re: Serving static file on Windows

2011-05-24 Thread shofty
ignore that last comment, im clearly behind a version! not sure why you're needing to static.serve the static files, if you're on django 1.3 it does that bit for you. On May 24, 9:22 am, Alagu Madhu wrote: > Hi, > > sample/ >           media/ >                    

Annotate with a filtered Count

2011-05-24 Thread Casey Greene
I am trying to figure out how to annotate with a count that is filtered. Here is a quick example of the situation and what I'm looking for: models.py: class A(models.Model): name = models.CharField(...) ... class B(models.Model): date = models.DateField(null=False) ... ---

Re: Serving static file on Windows

2011-05-24 Thread shofty
I thought we were still on jquery 1.5.1? Matt On May 24, 9:22 am, Alagu Madhu wrote: > Hi, > > sample/ >           media/ >                     js/jquery.1.6.1.min.js >                  css/ >            static/ >                     js/jquery.1.6.1.min.js >                  

Re: CRUD Tutorial

2011-05-24 Thread Mike Wisniewski
Yup, that is correct. I'm starting to pull my hair out because I can't find a decent one. Most of them that I've seen either use the generic view or don't really go into explanation. There are also lots of tutorials, many of them use the admin interface, which isn't what I want to do. Thanks!

Re: CRUD Tutorial

2011-05-24 Thread Boštjan Mejak
What does CRUD stand for? Is it Create Read Update Delete? -- 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

CRUD Tutorial

2011-05-24 Thread Mike Wisniewski
Hi! Could somebody please post an example CRUD program with a tutorial? It seems like this is a frequent request and I have yet find something decent. I've tried the django generator and it works, but it would be nice if somebody could explain what things do and how to do it. Thanks. -- You

Re: Dynamic Forms

2011-05-24 Thread Shawn Milochik
You can add fields dynamically in the __init__ of your form by processing the info passed in as the 'data' kwarg. Parse the info and just append fields to self.fields, something like this: self.fields['dynamic_field_' + field_num] = forms.CharField(max_length = 10) -- You received this

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Shawn Milochik
I create a folder called 'pyenv' in the root of my 'home' directory and put all of my virtualenvs there. I don't use the root user or the root home folder for anything, and you probably shouldn't either. If you're going to have multiple projects running on the same server, here's what I do.

Dynamic Forms

2011-05-24 Thread Afshin Moshrefi
I want to write a form which can dynamically add fields. I can simply add additional fields that I need with JavaScript but am not sure if that is the best way to handle this with Django? What are the best ways to handle creating and processing such dynamic form with Django? AM -- You

Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread AJ
Simon, Can you please give details of plugins that you use for Python/Django in MacVim? Thanks, AJ On Tue, May 24, 2011 at 12:51 PM, Simon Connah wrote: > > On 20 May 2011, at 21:18, Kevin Monceaux wrote: > > > On Fri, May 20, 2011 at 07:51:06AM -0400, Brian Bouterse

Re: Experiences with virtualenv + Django?

2011-05-24 Thread John Crawford
(sigh) Naturally as soon as I hit the [send] button, another question comes up :) I switched to my VPS, and was thinking about where to create a project, when I was wondering: How do people generally organize their virtualenv directories, and Django projects? I'm on as root on my machine, and

Re: Experiences with virtualenv + Django?

2011-05-24 Thread John Crawford
Thanks all, great answers. Sounds like virtualenv is better than I thought. And Shawn cleared up one of the misconceptions I had, I didn't realize it was possible to alt-install multiple versions of Python - I was trying to install 2.6 *under* virtualenv, which is not how it works. :) Still not

save and restore session

2011-05-24 Thread CrabbyPete
I'm trying to access LinkedIn using Oauth. I don't want to log in with it, just get user info from it. I'm using a call back which creates an anonymous session on the callback. I want to save the session of the user who initiated the callback. Is there a way to save a session and then restore it

User model with application code

2011-05-24 Thread lingrlongr
Hi All, Django comes with its own authentication scheme, which includes the User model. So let's say I created my Django app, and I connect some of my models to the User model using the ForeignKey field type. If I delete a User object, I now have objects that used to refer to a valid User, but

UK-based Django Host?

2011-05-24 Thread Nan
I know this question has been asked before, but the most recent thread I can find in the archives is from 2007, and presumably the landscape has changed since then. I'm looking for a Webfaction-like host with servers in the UK. It needs to allow long-running processes, of course, and would

Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread Simon Connah
On 20 May 2011, at 21:18, Kevin Monceaux wrote: > On Fri, May 20, 2011 at 07:51:06AM -0400, Brian Bouterse wrote: > >> +1 for vim > > I'll second that motion. I've tried numerous other editors and keep > sticking with vim for almost everything. I do use emacs for my e-mail > editor, with

Re: Logging SQL queries

2011-05-24 Thread Shawn Milochik
I recommend logging to a file. Here's a handler: 'django_log_file': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', 'filename': '/tmp/myproject_django.log', 'formatter': 'verbose', 'backupCount': 50,

Logging SQL queries

2011-05-24 Thread candlerb
I have Django 1.3 installed, and would like the built-in 'runserver' to show me the SQL queries it is executing. I found this thread: http://groups.google.com/group/django-users/browse_thread/thread/9ed3ea72afc02ee8/a5df8c062640d063?show_docid=a5df8c062640d063=1=1 However, after reading the

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Тимур Зарипов
I'd really reallly suggest you to use lxml library for xml parsing -- it has xpath in it. On Tue, May 24, 2011 at 2:13 PM, Sithembewena Lloyd Dube wrote: > Hi Everyone, > > I am trying to parse an XML feed and display the text of each child node > without any

Re: Is there an HTML editor that's Django-aware

2011-05-24 Thread Тимур Зарипов
+1 for Aptana -- it's Eclipse-based IDE, so Eclipse plugins are also available (Aptana + Mylyn in my case). On Sat, May 21, 2011 at 2:19 AM, W Craig Trader wrote: > On 05/20/2011 05:54 AM, BobX wrote: > >> Pretty obvious question, but is there any recommended HTML editor

Re: abstact model base class field override

2011-05-24 Thread Bill Freeman
In order to be a better metaphor in the common cases, python's metaclass features are used to do special things with field type elements. You will have already noticed that the field attributes of an *INSTANCE* of a model class are not field objects, or even properties, but simple attributes.

Re: hi

2011-05-24 Thread Andre Terra
You can define a value for the model's field by using the commit=False "trick". myform.save(commit=False) returns an instance of the model which hasn't yet been saved to the database. So you can manually set the value for any additional fields and then call save on the object to finally write it

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Andre Terra
Here's my go-to reference guide to using virtualenv and pip for django development[1]. The same steps apply to deployment, to some extent. Additionally, I recommend you checkout virtualenvwrapper[2]. It makes your life incredibly easier and switching virtualenvs becomes as simple as typing

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Shawn Milochik
On 05/24/2011 09:53 AM, Brian Bouterse wrote: Python is embedded so deeply into operating systems these days that not using virtualenv is a bad idea. Here is what happened to me once: 1. I went to pip intall a python package without virtualenv 2. The installation failed leaving my python

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Brian Bouterse
Python is embedded so deeply into operating systems these days that not using virtualenv is a bad idea. Here is what happened to me once: 1. I went to pip intall a python package without virtualenv 2. The installation failed leaving my python system raising an interpreter error when going to

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Shawn Milochik
1. You can compile Python 2.6 (or 2.7) in your home directory and use that to create your virtualenvs. 2. I do 100% of my Python work with virtualenv, and would never do otherwise. 3. It is not a nightmare AT ALL, and is wonderful. 4. With pip install, pip freeze, and pip install -r it's

Re: Example uses of Celery

2011-05-24 Thread Shawn Milochik
We use Celery & RabbitMQ for the following: Scheduling SMS & e-mail for times in the future based on appointments. Making deposits on debit cards. Regularly-scheduled report e-mail notifications. Async e-mail & sms alerts to users when certain activity occurs. Compiling

Anyone using google closure library with django?

2011-05-24 Thread Praveen Krishna R
Hi guys, Anybody here use closure library from google. ? How do u compare it to jQuery ? I have used jQuery only yet -- Thanks and Regards, *Praveen Krishna R* -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: GET/POST

2011-05-24 Thread egilchri
Thanks for those pointers. I think I'll have to try using something like csrf_exempt(). The reason is, I'm working with an API (It's for a voice application), and the API works as follows. You create an app, that among other things, is able to take apart the "session" data that is initially

Re: Trouble with "event_set" syntax

2011-05-24 Thread Daniel Roseman
On Tuesday, May 24, 2011 1:51:30 PM UTC+1, Gchorn wrote: > > Hi All, > > I'm trying to create a website that aggregates information about the > various products made by different companies. To that end, I have > models (classes) for companies, products, and events. Since each > company has

Re: installing django

2011-05-24 Thread Piotr Zalewa
On 05/24/11 07:40, bh.hoseini wrote: hi there, i installed django on vista, but i don't know how to combine it with python, i read installation guide but it wasn't ussefull! : I had some troubles install Django on Win7 In the end I used cygwin - it worked fine, although it's not clean Win. I

Trouble with "event_set" syntax

2011-05-24 Thread Gchorn
Hi All, I'm trying to create a website that aggregates information about the various products made by different companies. To that end, I have models (classes) for companies, products, and events. Since each company has various products, each product is related to one or more companies by a

Re: Example uses of Celery

2011-05-24 Thread Rob
I use celery for the following: 1. Expensive tasks that you don't want the user waiting on. For example: sending messages; we have triggers for SMS, Email and iPhone APN messages. I don't want the request/response waiting around while I do all of that. 2. Tasks that could fail and need to

Re: Autocomplete on Inlines ForeignKey

2011-05-24 Thread Vinicius Massuchetto
2011/5/24 Karen Tracey : > On Tue, May 24, 2011 at 6:51 AM, Vinicius Massuchetto > wrote: >> >> Have anyone been able to implement an autocomplete input field in an >> inline formset? If so, please provide some references. >> >> The main apps

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Simon Connah
On 24 May 2011, at 12:34, Stuart MacKay wrote: > > The only problem you might come across is when updating source code from a > repository is that any changes you make will be overwritten. So for example > to use staticfiles with django 1.3 I had to rename directories in > django-autocomplete

Re: problem with intalling python 2.7.1

2011-05-24 Thread Karen Tracey
On Tue, May 24, 2011 at 2:00 AM, bh.hoseini wrote: > hi! > i installed python 2.7.1 on vista, then opened "command line", and > wrote "django-admin.py startproject mysite" at first, but i faced > syntax error:invalid syntax. could you help me solve this problem?! > > It

Re: Autocomplete on Inlines ForeignKey

2011-05-24 Thread Karen Tracey
On Tue, May 24, 2011 at 6:51 AM, Vinicius Massuchetto < viniciusmassuche...@gmail.com> wrote: > Have anyone been able to implement an autocomplete input field in an > inline formset? If so, please provide some references. > > The main apps that do this in a normal form can't render the same >

Re: Testing with managed tables

2011-05-24 Thread Karen Tracey
On Mon, May 23, 2011 at 12:47 PM, Vincent wrote: > Whenever I try to run unit tests with my managed tables, Django > insists on re creating the test database, and then the tables do not > get created for testing. in providing initial data, there seems to be > no place to

Re: MultiValueField and MultiWidget

2011-05-24 Thread Karen Tracey
On Mon, May 23, 2011 at 11:27 AM, CH wrote: > Django's documentation doesn't do a very thorough job of explaining > how to use MultiValueField and MultiWidget. I've tried dissecting the > one implementation [1] and haven't had good results. Would someone > mind giving

Re: installing django

2011-05-24 Thread Stuart MacKay
Without any more information on what problems you are experiencing it is very dificult to know where to start. I would recommend reading the First Steps section of the Django Documentation, http://docs.djangoproject.com/en/1.3/ That will help in two ways, first it is a good guide for

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Stuart MacKay
John, Regarding Python 2.6 on CentOS you might find this article useful: http://blog.milford.io/2010/06/alt-installing-python-2-6-from-source-in-centos/ I use virtualenv on a VPS running Ubuntu 10.04 LTS with Django 1.2, django-cms and about 10 other installed apps in various combinations.

Django forms, inheritance

2011-05-24 Thread feng yu
Hi all ,i have a question about Django forms in inheritance this is my models below class Database(models.Model): TYPE_CHOICES = ( (u'0',u'Oracle'), (u'1',u'MySQL'), ) name = models.CharField(max_length=200,unique=True) type =

Access queryset in get_context_data()?

2011-05-24 Thread Florian Hahn
Hi, is there a way to access queryset from get_context_data without executing the query twice in a class based view? cheers -- 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

installing django

2011-05-24 Thread bh.hoseini
hi there, i installed django on vista, but i don't know how to combine it with python, i read installation guide but it wasn't ussefull! :( -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

problem with intalling python 2.7.1

2011-05-24 Thread bh.hoseini
hi! i installed python 2.7.1 on vista, then opened "command line", and wrote "django-admin.py startproject mysite" at first, but i faced syntax error:invalid syntax. could you help me solve this problem?! -- You received this message because you are subscribed to the Google Groups "Django

Disable debug logging for django.db.backends?

2011-05-24 Thread diafygi
Howdy all, I have DEBUG=True in my settings.py, and I have several logging entries in my project (Django 1.3) However, when I am testing, there are tons of django.db.backends debug entries that appear, and my logs gets lost in the shuffle. Is there a way to disable django.db.backends in my

Autocomplete on Inlines ForeignKey

2011-05-24 Thread Vinicius Massuchetto
Have anyone been able to implement an autocomplete input field in an inline formset? If so, please provide some references. The main apps that do this in a normal form can't render the same behavior in an inline. Many thanks. -- Vinicius Massuchetto http://vinicius.soylocoporti.org.br -- You

Re: Parsing an XML feed using ElementTree

2011-05-24 Thread Daniel Roseman
On Tuesday, May 24, 2011 11:13:31 AM UTC+1, Lloyd Dube wrote: > > Hi Everyone, > > I am trying to parse an XML feed and display the text of each child node > without any success. My code in the python shell is as follows: > > >>>import urllib > >>>from xml.etree import ElementTree as ET > >

Re: Model filter on date ranges

2011-05-24 Thread sushanth Reddy
Thank you for the response,Let me give a try and let you know. Thanks & Regards sushanth reddy On Tue, May 24, 2011 at 12:30 PM, Ori Livneh wrote: > Check out the python-dateutil module > (not in the standard lib, but available via pip

Parsing an XML feed using ElementTree

2011-05-24 Thread Sithembewena Lloyd Dube
Hi Everyone, I am trying to parse an XML feed and display the text of each child node without any success. My code in the python shell is as follows: >>>import urllib >>>from xml.etree import ElementTree as ET >>>content = urllib.urlopen('

Re: form being deleted from base.html

2011-05-24 Thread Amit Sethi
Hi all sorry it was an issue with my html. -- A-M-I-T S|S -- 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: GET/POST

2011-05-24 Thread Amit Sethi
I think this is csrfmiddleware issue . Just add {% csrf_token %} like this {% csrf_token %} -- A-M-I-T S|S -- 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

form being deleted from base.html

2011-05-24 Thread Amit Sethi
Hi all , I am not able to understand this but it seems while extending the base template removes form tag. Is this possible in some scenario. This is the only explanation I am able to come up with for the behavior I am seeing in my app. -- A-M-I-T S|S -- You received this message because you

Serving static file on Windows

2011-05-24 Thread Alagu Madhu
Hi, sample/ media/ js/jquery.1.6.1.min.js css/ static/ js/jquery.1.6.1.min.js css/ settings.py import os PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) MEDIA_ROOT =

Re: Authenticating from a mysql database

2011-05-24 Thread Uwe Schuerkamp
On 24 Mai, 00:17, Jonas Geiregat wrote: > > In case I'd decide to migrate the existing users over to the new > > database, how could I make sure the passwords end up in django > > correctly? All I have is the old_password()-crypted user passwords, > > can I simply insert

Re: Model filter on date ranges

2011-05-24 Thread Ori Livneh
Check out the python-dateutil module (not in the standard lib, but available via pip and easy_install). It makes calculating time deltas easy. Anyways, try something like this: #!/usr/bin/env python from datetime import datetime from dateutil.relativedelta