Re: Displaying single-line progress while a management command runs

2016-05-23 Thread Phil Gyford
> > Den 9. maj 2016 kl. 14.23 skrev Phil Gyford <gyf...@gmail.com>: > > > > I have a custom management command which calls a method in another > class, which fetches lots of data from a third-party API. Fetching the data > could take a few seconds or it could take ov

Displaying single-line progress while a management command runs

2016-05-09 Thread Phil Gyford
I have a custom management command which calls a method in another class, which fetches lots of data from a third-party API. Fetching the data could take a few seconds or it could take over an hour, depending on the quantity. I'd like to display progress on the command line, so the user knows the

How best to cache a queryset of Comments?

2013-03-14 Thread Phil Gyford
I have a site that uses the standard Django Comments app (well, a subclass of it, with not many changes) for comments on different content types. I'd like to be able to cache a list of comments, as fetching the comments is one of the most frequent and slowest queries that's happening at the

Re: Having LiveServerTestCase use same database as tests

2012-10-21 Thread Phil Gyford
UTC+7 пользователь Phil Gyford написал: > > I'm writing integration tests using LiveServerTestCase/Selenium in > v1.4.1. By default the process that's started by LiveServerTestCase > uses a different database to the test database used by the tests. This > is a pain because I can't use

Re: django.contrib.markup deprecated in 1.5 - what's the alternative?

2012-09-16 Thread Phil Gyford
Thanks for the pointer Jirka - I hadn't managed to find that ticket. Makes sense and, like you, I only have a few trusted users entering text that will be filtered. On 15 September 2012 19:37, Jirka Vejrazka wrote: > Hi Phil, > > incidentally, I was looking at this

django.contrib.markup deprecated in 1.5 - what's the alternative?

2012-09-15 Thread Phil Gyford
I noticed that django.contrib.markup is marked as deprecated in Django 1.5 . If I'm starting a new project now, what alternative should I be using, to avoid running into problems with future versions of Django? I could write my own

Having LiveServerTestCase use same database as tests

2012-08-21 Thread Phil Gyford
I'm writing integration tests using LiveServerTestCase/Selenium in v1.4.1. By default the process that's started by LiveServerTestCase uses a different database to the test database used by the tests. This is a pain because I can't use factories (I'm using FactoryBoy at the moment) to create data

Re: Unit test failing when testing post of a comment

2010-11-14 Thread Phil Gyford
of these, and using empty strings if they're not present, has got things working again. On Thu, Nov 11, 2010 at 5:30 PM, Phil Gyford <gyf...@gmail.com> wrote: > Hi, > > I have a unit test that tests that a comment can be posted on an entry > in a Django blog. Posting a comment myself in the

Unit test failing when testing post of a comment

2010-11-11 Thread Phil Gyford
Hi, I have a unit test that tests that a comment can be posted on an entry in a Django blog. Posting a comment myself in the browser works fine, but the test always fails with this error: "TemplateSyntaxError: Caught VariableDoesNotExist while rendering: Failed lookup for key [request] in

Re: What does an ideal django workflow setup look like?

2010-10-22 Thread Phil Gyford
After reading a few articles on this kind of thing, I tried to figure out a good, repeatable way to do some of this, and wrote up the whole process here: http://www.gyford.com/phil/writing/2010/09/29/django-environment.php It doesn't (yet) cover the best ways of integrating dev/production

Re: Customising comment framework and keeping moderation working

2010-10-06 Thread Phil Gyford
t; It works fine: comments can successfully be disabled on a per-Entry >> basis. But, if you add "from weblog.models import Entry" to either >> customcomments/forms.py or customcomments/models.py then comments are >> *always* allowed through. Any idea why? Thanks. >&g

Re: Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
to either customcomments/forms.py or customcomments/models.py then comments are *always* allowed through. Any idea why? Thanks. On Tue, Oct 5, 2010 at 2:46 PM, Phil Gyford <gyf...@gmail.com> wrote: > I've investigated further and... it's very strange. > > I've got a version of my

Re: Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
just want to understand the solution now! Any help very much appreciated. On Tue, Oct 5, 2010 at 11:27 AM, Phil Gyford <gyf...@gmail.com> wrote: > Hi, > > I can't get my extended version of django.contrib.comments to take > notice of moderation. > > If I use the standard co

Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
Hi, I can't get my extended version of django.contrib.comments to take notice of moderation. If I use the standard comments framework, then my subclass of CommentModerator does the job - I've just used it to define enable_field, and this allows or prohibits comments as expected. But if I switch

Re: Error configuring Django to run customized comments framework

2010-10-02 Thread Phil Gyford
A bit late, so you may have solved this or given up on it, but still... I just had the same error message and eventually solved it by changing the order of my INSTALLED_APPS. So maybe you have slightly different settings on your local and live servers, and the apps are ordered differently on each?