Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PrettyTime play nice with Django F expressions #3

Open
jdotjdot opened this issue Jul 28, 2014 · 0 comments
Open

Make PrettyTime play nice with Django F expressions #3

jdotjdot opened this issue Jul 28, 2014 · 0 comments
Assignees

Comments

@jdotjdot
Copy link
Owner

Right now, though you can use the .then() method for anchoring on arbitrary dates or datetimes, it seems to throw an error when used with Django F expressions, like so:

expiry_date = models.DateField(default=lambda: t(3).months.from_.then(F('publish_date')))

For now, users will have to make do with the following, which does work:

expiry_date = models.DateField(default=lambda: F('publish_date') + relativedelta(months=+3))
@jdotjdot jdotjdot self-assigned this Jul 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant