Re: [ANNOUNCE] Security releases and advisory issued (1.7.6 and 1.8b2)

2015-03-09 Thread Francis Devereux
Hi, On 9 Mar 2015, at 16:01, Tim Graham wrote: > > Today the Django team issued multiple releases -- Django 1.7.6 and 1.8b2 -- > as part of our security process. These releases address a publicly reported > security issue, and we encourage all users to upgrade as soon as

Re: Traversing relationships based on lookup strings

2015-03-03 Thread Francis Devereux
> On 2 Mar 2015, at 22:11, James Schneider wrote: > > Nothing in Django specifically that I'm aware of (although that's not saying > much), but you can probably do something pretty slick with the operator > library and attrgetter: > >

Traversing relationships based on lookup strings

2015-03-02 Thread Francis Devereux
Hi, Is there a Django function that takes a model instance and a lookup string, and returns the value of the related field? For example: the_function_i_am_looking_for(trip, 'booking__client__name') would return the same as: trip.booking.client.name Thanks, Francis -- You received

Writing a test that POSTs to the admin change view

2013-08-19 Thread Francis Devereux
Hi, I would like to write a test that verifies that a particular message is shown when a model is saved in the admin that meets certain criteria (it's a warning message). First off I need to figure out how to post to the admin change view from test code. I figured it would be easier to start

Re: Django not enforcing blank=False on a model

2013-07-30 Thread Francis Devereux
On 30 Jul 2013, at 06:14, Jani Tiainen wrote: > Also, you should note that .save() doesn't imply running validation > If you want models to be automatically validated on .save() then you can use

Portable way to prepend string to all rows in a table

2012-12-06 Thread Francis Devereux
Hi, I currently have the following code in one of my migrations: cursor = connection.cursor() cursor.execute('''UPDATE travelbox_accommodationimage SET file = CONCAT('travelbox/accommodation/', url)''') transaction.commit_unless_managed() This works for us (on MySQL, which we are