Re: Aggregation / annotation over results of a subquery

2016-05-23 Thread Malcolm Box
UNREAD, > then='messages' > )), > ) > ).filter( > message_count__gte=1, > ).order_by('-message_count') > > Cheers, > Simon > > [1] > https://docs.djangoproject.com/en/1.9/ref/models/conditional-expressions/#conditional-aggregation > > Le vendredi 20

Aggregation / annotation over results of a subquery

2016-05-20 Thread Malcolm Box
Hi all, I'm trying to get the ORM to let me sort things based on an annotation, where that annotation requires a subquery to select items to consider. Concrete example, given models: class Contact(models.Model): name = models.CharField() class Message(models.Model): sender =

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
ck the result of get_readonly_fields() rather than just obj.readonly_fields. What do you think? Malcolm Simon > > Le jeudi 10 septembre 2015 06:27:13 UTC-4, Malcolm Box a écrit : >> >> Hi Simon, >> >> I've tried that, and it still fails the same sy

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
Ticket filed: https://code.djangoproject.com/ticket/25374 On Thursday, 10 September 2015 11:27:13 UTC+1, Malcolm Box wrote: > > Hi Simon, > > I've tried that, and it still fails the same system check. > > The system check checks that all the values returned from > get_

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
should enter feature freeze soon enough. I'd be glad to review your > proposed changes if you're interested. > > Simon > > > Le mercredi 9 septembre 2015 10:31:12 UTC-4, Malcolm Box a écrit : > >> Hi Simon, >> >> Thanks for the pointer, but I d

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-09 Thread Malcolm Box
elds() > <https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields> > to return them as well. > > Cheers, > Simon > > Le mardi 8 septembre 2015 13:31:47 UTC-4, Malcolm Box a écrit : >> >> Hi, >> >> I'm trying to add a d

Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-08 Thread Malcolm Box
Hi, I'm trying to add a dynamic method to a ModelAdmin so that I can have automatically generated thumbnail fields for any image by simply adding '_thumbnail' to the field definitions - which saves a lot of code when there's a load of admin classes with image fields that need thumbnails.

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Malcolm Box
On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: > > On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box <mal...@tellybug.com > > wrote: > >> I'm confused by Django's behaviour when saving related models. Take for >> example: >> >> I kin

Re: How to receive json data using HTTP POST request in Django 1.6?

2014-06-10 Thread Malcolm Box
Simplest answer is to use Django Rest Framework, which makes this extremely easy. Malcolm On Monday, 9 June 2014 11:20:05 UTC+1, Alok Singh Mahor wrote: > > Hi all, > > I am trying to receive JSON data using HTTP POST in django 1.6. > I tried using request.POST['data'], request.raw_post_data,

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Malcolm Box
The canonical answer to this is to use Celery, which provides a task queue for any background/scheduled tasks you want to use. It's pretty easy to get set up, and works well. Malcolm On Tuesday, 10 June 2014 06:37:46 UTC+1, Rini Michael wrote: > > Hi, > i am looking for a way where i can

Why doesn't saving a related model update the _id field?

2014-06-08 Thread Malcolm Box
I'm confused by Django's behaviour when saving related models. Take for example: class X(models.Model): pass class Y(models.Model): x = models.ForeignKey(X) Now if I create some objects (unsaved): x = X() y = Y(x=x) All well so far. But now odd things happen when I save: A) y.save()

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread Malcolm Box
On 10 November 2011 08:54, ionic drive wrote: > Hello django friends, > > Problems: > > 1) MemcachedKeyCharacterError: Control characters not allowed > 2) MemcachedKeyLengthError: Key length is > 250 > > The obvious solution is not to generate keys with these

Re: Caching at model class level

2011-11-04 Thread Malcolm Box
On 4 November 2011 07:02, Thomas Guettler wrote: > Am 03.11.2011 18:42, schrieb Tom Evans: > > On Thu, Nov 3, 2011 at 2:22 PM, Thomas Guettler wrote: > >> Hi, > >> > >> I try to reduce the number of db-queries in my app. > >> > >> There is a model which

Re: Login problems under heavy load

2011-10-31 Thread Malcolm Box
On 24 October 2011 12:01, Tom Evans wrote: > On Fri, Oct 21, 2011 at 6:15 PM, Alpesh Gajbe > wrote: > > > > File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py", > > line 296, in read > > return self._stream.read(*args,

Re: Django tutorial hasn't received an update for 1.3

2011-10-31 Thread Malcolm Box
Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl

Re: CAS and Django cache

2011-10-27 Thread Malcolm Box
Yes, get followed by set can lead to data loss. What you want is cache.add(). This sets the value if and only if there is no existing value. Its atomic on backends that support it - notably memcached. Sent from my iPhone, please excuse any typos On 27 Oct 2011, at 07:26, Dan Julius

Re: Is it possible to run from Django script?

2011-09-21 Thread Malcolm Box
On 20 September 2011 21:36, Stone wrote: > Dear users, > > I have simple question which regards with running script from view.py. > > Is it possible to do that over subprocess command? > > Yes, you can run a script from within your view. Whether you *should* or not depends

Re: django and thrift

2011-09-08 Thread Malcolm Box
On 8 September 2011 03:27, Li Lirong wrote: > Hi, > Thank you for your comments. I am new to both django and thrift. I > am hosting my service with a shared web hosting server. That's why I > want to use django to expose a thrift API. Basically, what I want is > to

Re: In unitTest, GET Formset returns 302 instead of 200

2011-09-07 Thread Malcolm Box
On 7 September 2011 11:52, MATHIEU wrote: > For the GET method, I have tried the following code: > >def test_patron_phone_get_form(self): >self.client.login(usernamer='alex...@e.com', > password='alex') >

Re: Pagination of more than one field

2011-09-07 Thread Malcolm Box
On 7 September 2011 14:57, OC wrote: > Thank you very much for your reply, > I changed it but I guess Im doing something wrong cause it still > doesnt work: > It tries to go to the right page now, but provides nothing although I > know there's more than one page: > > in

Re: django and thrift

2011-09-07 Thread Malcolm Box
On 7 September 2011 07:18, leon wrote: > Hi, > > I have one question. Is it possible to use Django to write thrift > (http://thrift.apache.org/) formated web service? If it is possible, > is there any sample? > > Possible, maybe. But almost certainly the wrong thing to

Re: Pagination of more than one field

2011-09-07 Thread Malcolm Box
On 7 September 2011 08:25, OC wrote: > also attaching relevant parts of view.py: > > > movpagin = Paginator(movies, 12) > >page = int(request.GET.get('page','1')) >try: >moviesp = movpagin.page(page) >except PageNotAnInteger: ># If page is not an

Re: Problem updating data

2011-08-24 Thread Malcolm Box
group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Malcolm Box malcolm@gmail.com

Re: Help installing django-sentry

2011-08-22 Thread Malcolm Box
Post your urls.py file - it looks like you have a pattern that is over aggressively matching /sentry as a poll. Malcolm Sent from my iPhone, please excuse any typos On 21 Aug 2011, at 21:18, tharshan muthulingam wrote: > Hi, > I have been having alot of trouble trying

Re: Best approach to handling different types of Users

2011-08-20 Thread Malcolm Box
On 19 August 2011 03:37, Andre Terra wrote: > Until you install some third party app that accesses > User.objects.all() and then suddenly nothing works as it's supposed > to. > > I hear this a lot that "things will break" if you subclass User. However, I haven't seen anyone

Re: Django Test Corrupted Test Data

2011-08-20 Thread Malcolm Box
to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Malcolm Box malcolm@gmail

Re: how to invalidate per-view cache?

2011-08-20 Thread Malcolm Box
remove the entry. Malcolm -- Malcolm Box malcolm@gmail.com -- 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 django-users+u

Re: Specific models without a database table

2011-08-20 Thread Malcolm Box
On 20 August 2011 02:33, Kristofer Pettijohn wrote: > Hello, > > Is it possible to create specific models without a database table? > > Yes, it's possible. You want the "managed" attribute on the model - see

Re: Django for a front end designer

2011-08-03 Thread Malcolm Box
hours twiddling obscure X-Windows settings to get a desktop that works. Oh, and the battery life is good. Malcolm -- Malcolm Box malcolm@gmail.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: [django] Get request URL

2011-08-03 Thread Malcolm Box
ived 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit t

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Malcolm Box
On 22 July 2011 13:52, Jacob Kaplan-Moss wrote: > On Thu, Jul 21, 2011 at 5:03 PM, br wrote: > > I am running on a Linode 768 VPS and may have some stuff going live > > before too long. I'm wondering what the best way to guage whether I > > have enough

Re: Problem with relationships in models

2011-07-21 Thread Malcolm Box
go users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/IiaS26VAlVAJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com

Re: import django models without runing the server

2011-07-21 Thread Malcolm Box
On 18 July 2011 15:41, Shawn Milochik wrote: > On Mon, Jul 18, 2011 at 10:33 AM, bruno desthuilliers > wrote: > > On Jul 18, 3:33 pm, Alexander Crössmann > > wrote: > >> Hi Malcom, > >> > >> I am not sure the

Re: Django - can't open image in model save()

2011-07-18 Thread Malcolm Box
On 18 July 2011 02:04, galgal wrote: > def upload_path_handler(instance, filename): > > return filename > > class SpectacleGallery(models.Model): > > image = models.ImageField(upload_to=upload_path_handler) > > def save(self, *args, **kwargs): > >

Re: import django models without runing the server

2011-07-18 Thread Malcolm Box
On 18 July 2011 13:34, Alexander Crössmann wrote: > Hi, > > I want to write a python script that works with django models without > runing the server. My OS ist Ubuntu 10.10. > > I'd suggest using Django management commands:

Re: Scaling to 30k requests (malcolm box blog)

2011-07-11 Thread Malcolm Box
Thanks for the recommendations Cal. I hope this stuff is of use to some people - let me know if anyone wants to know more. On 10 July 2011 21:06, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Came across the following blog entries today, for those interested

Re: 'WSGIRequest' object has no attribute 'update'

2011-07-11 Thread Malcolm Box
Hi,. On 11 July 2011 08:29, Phang Mulianto wrote: > > > return render_to_response(template_name, locals(), > context_instance=(request)) > The bug is in this line. render_to_response() takes a dictionary as the context_instance, but this code just passes the request

Re: my frist django project Error

2011-07-10 Thread Malcolm Box
Cal, You are contributing a lot to the django users group, but this response isnt in the best spirit of the group. Yes, the op could work out from the traceback what the error was, but we were all beginners once. If you compare this post to the how to post FAQ its not too bad - at least

Re: Speed of search question

2011-07-06 Thread Malcolm Box
On 6 July 2011 08:17, Benedict Verheyen wrote: > > I have these models (not really but it's to explain my question :)) > > class Calendar(models.Model): >name = models.CharField(max_length=60) >description = models.TextField(blank=True) >appointment =

Re: change values in "select list"

2011-07-06 Thread Malcolm Box
On 6 July 2011 09:48, Geoff Kuenning wrote: > > And in any case, this forum would be greatly improved if the general > snarkiness herein departed for Antarctica and never returned. > > Hear, hear! (For non-native speakers, that means "I agree"). The Django-users list has

Re: upload file isn't working

2011-06-27 Thread Malcolm Box
On 24 June 2011 17:36, raj wrote: > > def upload_view(request): >user = request.user >if user.is_authenticated(): >if request.method == 'POST': >form =upload_form(request.POST, request.FILES, user) >if form.is_valid(): >

Re: please recommend a video streaming app/lib

2011-06-26 Thread Malcolm Box
Adobe video server. It's the de facto standard and you can get access via amazon ec2 easily. On Jun 26, 2011 5:31 AM, "akonsu" wrote: > hello, > > can anyone recommend a library or an application for video streaming > that can be used in a commercial site that requires good

Re: mach-o, but wrong architecture

2011-06-23 Thread Malcolm Box
Re your cacheing problem the behaviour you are seeing is exactly what would be expected using locmem cache. Apache is presumably running multiple processes each of which will have it's own locmem cache. Since the odds ate against two successive requests hitting the same apache process, you

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Malcolm Box
On 22 June 2011 14:15, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi all, > > Therefore, I'd like to see if there would be any interest in webcast in > which I would explain how we handle such large amounts of data, the trial > and error processes we went

Re: csrf protection and testing with tsung

2011-06-22 Thread Malcolm Box
On 22 June 2011 09:52, Ivan Uemlianin wrote: > > Thanks very much for your help!  You were exactly right.  The > following config works (simplified for exposition). Glad that helped, and thank you for coming back with the working settings for anyone else who runs into the

Re: csrf protection and testing with tsung

2011-06-21 Thread Malcolm Box
On 21 June 2011 16:48, Ivan Uemlianin wrote: > With tsung you record a site visit (called a session) --- log in, view > various pages, do a few things, log out --- and tsung will then hit > the site with lots of randomised versions of this session. > > Many of the views

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Malcolm Box
On 21 June 2011 15:47, Jeff Blaine wrote: > Okay, here's the problem. > > >>> f = dev._meta.get_field('distro') > >>> f.value_from_object(dev) > 2L > > >>> f.attname > 'distro_id' > >>> > > As others guessed, value_from_object() is returning the pk ID in this > case. > >

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Malcolm Box
On 21 Jun 2011, at 01:53, Jeff Blaine wrote: > >>> from hostdb.models import Device, Interface > >>> hostname = 'beijing.mitre.org' > >>> dev = Interface.objects.get(fqdn=hostname).device > >>> dev.status > > >>> f = dev._meta.get_field('status') > >>> f.value_from_object(dev) > u'Online' > >>>

Re: Why does OpenLayers not load in django with this template ?

2011-06-19 Thread Malcolm Box
On 17 Jun 2011, at 23:07, Satyajit Sarangi wrote: > > This is my template . > > > Where should I store the OpenLayers-2.10 folder for this template to > work ? Almost certainly there is no such place. Assuming your web page is at http://example.com/a/path/to/page, you've told it to look

Re: Authentication in API (REST)

2011-06-14 Thread Malcolm Box
I think oauth solves this problem well. What do you see wrong with it? Malcolm Sent from my iPhone, please excuse any typos On 14 Jun 2011, at 16:35, Stuart MacKay wrote: > Neznez, > > The authentication problem is one that has never really been solved to any

Re: Updating static files: Still in browser cache

2011-06-10 Thread Malcolm Box
On 10 June 2011 14:54, Thomas Guettler <h...@tbz-pariv.de> wrote: > On 09.06.2011 19:18, Malcolm Box wrote: > > On 9 Jun 2011, at 14:21, DrBloodmoney <drbloodmo...@gmail.com> wrote: > > > >> On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box <malcolm@gmail.c

Re: Authentication in API (REST)

2011-06-10 Thread Malcolm Box
On 10 June 2011 01:26, Yohanes Adhi Nugraha wrote: > > Not that one, if we use django.contrib.auth and @login_required, it's > only redirects you to login page. > What I saw from another site is, browser will popup an alert with > username and password to be filled. > >

Re: Authentication in API (REST)

2011-06-09 Thread Malcolm Box
On 9 June 2011 17:51, Neznez wrote: > Hi all, I'm newbie in Django, and I started to build my own API. I > know that there is Piston or Django REST framework, but I want to > learn API from scratch. What I want to know is, how to make my HTTP > Response (View) is perform

Re: Boolean field, unexpected behavior

2011-06-09 Thread Malcolm Box
On 9 June 2011 21:16, elliot wrote: > However, I'm still not clear why i can save without specifying values > for the CharField or BooleanField. I didn't say null="true", and I > didn't provide default values. > > Because both have sensible default values ("" for

Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box
Sent from my iPhone, please excuse any typos On 9 Jun 2011, at 14:21, DrBloodmoney <drbloodmo...@gmail.com> wrote: > On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box <malcolm@gmail.com> wrote: >> On 9 June 2011 08:09, Thomas Guettler <h...@tbz-pariv.de> wrote: >&

Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box
On 9 June 2011 08:09, Thomas Guettler wrote: > My static files (JS/CSS) are cached in the browser. But if there is a bug > in a file, an update won't help people which have already cached the old > file. > > You would need a new URL for every change in the JS/CSS files. > >

Re: django transactions.

2011-06-09 Thread Malcolm Box
On 8 June 2011 11:07, Marc Aymerich <glicer...@gmail.com> wrote: > On Tue, Jun 7, 2011 at 11:53 PM, Malcolm Box <malcolm@gmail.com> > wrote: > > n 7 June 2011 15:16, Marc Aymerich <glicer...@gmail.com> wrote:You're > right :) I'm using Mysql with myisam, I'm g

Re: 2 projects based on the same codebase

2011-06-09 Thread Malcolm Box
On 9 June 2011 08:06, Benedict Verheyen wrote: > > I developed a calltracking for our team and now, another team is interested > to have their own calltracking. > The best way to seem to deal with a project that is the same from the > start, is to makea new

Re: Re: Odp: Re: signals pre_save vs model's save()

2011-06-07 Thread Malcolm Box
On 2 June 2011 23:37, Mateusz Harasymczuk wrote: > That was a very good and convincing post :} > I am testing a solution with .clean(), which IMHO is a better place to > clean data before save() > > Glad to have been of help. clean() is ideal for cleaning up stuff from

Re: django transactions.

2011-06-07 Thread Malcolm Box
n 7 June 2011 15:16, Marc Aymerich wrote: > Hi, > I've activated the > 'django.middleware.transaction.TransactionMiddleware' and I've > decorated one method with @transaction.commit_on_success > With this I expect that if the method raise an exception, django rolls > back

Re: Users not logging out

2011-06-07 Thread Malcolm Box
On 7 June 2011 15:14, Derek wrote: > On Jun 7, 3:39 pm, jayhalleaux wrote: > > i take that back. > > > > If I log in and then I close the tab, I can go back and still use the > > url to go to a login required page. > > close_tab != CLOSE_BROWSER > >

Re: repr(request.session)

2011-06-07 Thread Malcolm Box
n 7 June 2011 10:46, Henrik Genssen wrote: > I try to add the content of my session to the error-mails. > I have written a middleware, overwriting the standard error mail. > But for: > repr(request.session) > I only get: > > > What am I doing wrong? > > That is the how

Re: Odp: Re: signals pre_save vs model's save()

2011-06-02 Thread Malcolm Box
On 29 May 2011, at 15:53, Mateusz Harasymczuk wrote: > W dniu niedziela, 29 maja 2011, 15:36:13 UTC+2 użytkownik Malcolm Box napisał: > On 28 May 2011 11:05, Mateusz Harasymczuk <mat...@harasymczuk.pl> wrote: > I am thinking about splitting my model's save() method o

Re: Disable debug logging for django.db.backends?

2011-06-02 Thread Malcolm Box
Alternatively, configure your logging handlers to send the db logging somewhere else (ie another file), and not to pass it on. So in settings.py have: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'file_logging': { 'level' : 'DEBUG',

Re: How to create user on mobile app for Django site?

2011-06-02 Thread Malcolm Box
On 31 May 2011, at 12:35, Ivo Brodien wrote: > What is the correct way to do the following: > > 1) Mobile App from which a user can create a user/profile on the Django site > 2) Allow authenticated users to create on the site and query personalized > data from the site > > This is what I guess

Re: signals pre_save vs model's save()

2011-05-29 Thread Malcolm Box
On 28 May 2011 11:05, Mateusz Harasymczuk wrote: > I am thinking about splitting my model's save() method over few signals. > > For example, stripping spaces and making string capitalized. > > Why would you want to do that? > I have even more sophisticated problems such

Re: choice_set.all()

2011-05-29 Thread Malcolm Box
googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Malcolm Box malcolm@gmail.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-28 Thread Malcolm Box
You need to tell django what the db column name for your pollkey field is. Look at the dbname field option in the docs. Sent from my iPhone, please excuse any typos On 28 May 2011, at 05:13, Naoko Reeves wrote: > I see if column is set to AutoField then Django won't

Re: caching ajax json (post)

2011-05-27 Thread Malcolm Box
hoose what comes back from your views. Malcolm -- Malcolm Box malcolm@gmail.com -- 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 gro

Re: Caught RuntimeError while rendering: invalid label:

2011-05-26 Thread Malcolm Box
On 26 May 2011 20:50, Bobby Roberts wrote: > anyone have any idea what invalid label means? > > Where are you getting this error? What did you do to trigger it? If you can give us more information, it's more likely that someone will be able to help you. Malcolm -- You

Re: Admin broken with large data table

2011-05-26 Thread Malcolm Box
On Mar 29, 4:31 pm, Malcolm Box <malcolm@gmail.com> wrote: > On Mar 29, 2:48 pm, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > > > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box <malcolm@gmail.com> wrote: > > > On one of my models, the admin choice_li

Re: Userprofile, signal and admin inline edit.

2011-05-26 Thread Malcolm Box
On 26 May 2011 10:23, Jani Tiainen wrote: > If I extend auth.User with custom profile and add automatic profile > creation signal it works as expected. > > But if I try to add admin inline editor for profile when saving I get > exception about integration violation. > > It

Re: How do you organize your deployment enviroment

2011-05-23 Thread Malcolm Box
I'd heartily recommend chef - chef.opscode.com. Large library of scripts for almost any package or tool you're likely to want, scales out to lots of nodes but can be run in a simple solo mode for small deployments. Only downside is it's ruby but mostly you use the configuration language so

Re: Memcached backend - caching data with infinite timeout

2011-05-17 Thread Malcolm Box
On 17 May 2011 11:15, Tom Evans <tevans...@googlemail.com> wrote: > On Tue, May 17, 2011 at 11:03 AM, Malcolm Box <malcolm@gmail.com> > wrote: > > That looks like a bug in Django. I suggest you file a ticket. > > > > The fix would be to compare timeout

Re: Memcached backend - caching data with infinite timeout

2011-05-17 Thread Malcolm Box
That looks like a bug in Django. I suggest you file a ticket. The fix would be to compare timeout to None Sent from my iPhone, please excuse any typos On 17 May 2011, at 10:54, Paweł Roman wrote: > Python-memcached docstring for set() says this: > > """ > @param

Re: UTF-8 and files automatically created

2011-05-15 Thread Malcolm Box
Utf-8 and line endings are orthogonal issues. The problem is not that the files are not in utf-8, but that windows and Linux don't agree on what character means line-end. You will run into problems shipping unmodified windows line endings to a Linux box. Luckily the answer is git. This can be

Re: Problem in Configuring the database

2011-05-08 Thread Malcolm Box
On 7 May 2011 16:44, rahul raj wrote: > After this i wanted to install database.. as mentioned in documentation, i > did install mysql using YaST in OpenSUSE.. when i typed "mysql" in terminal > it showed an error -- " Can't connect to local > MySQL server through socket

ANN: Two-level caching for Django

2011-05-04 Thread Malcolm Box
Hi, We recently hit a bottleneck accessing a memcached server from Django on a big site. To solve it, I created two-level cache with a local cache on each Django box, and a global cache on the memcached machines. Under the sort of loads we were seeing, this dramatically reduced the load on the

Re: Admin broken with large data table

2011-03-29 Thread Malcolm Box
On Mar 29, 2:48 pm, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box <malcolm@gmail.com> wrote: > > On one of my models, the admin choice_list page is taking minutes to > > load, which makes it somewhat broken. > &

Re: Help on setting TIME_ZONE to 'UTC'

2011-03-29 Thread Malcolm Box
Look in the docs here: http://docs.djangoproject.com/en/1.3/ref/settings/#time-zone As it says, this doesn't work on Window and will result in the system timezone being used. On Mar 29, 8:58 am, aa bb wrote: > Hi all! I'm a Django newbie. I set TIME_ZONE to 'UTC' in

Admin broken with large data table

2011-03-29 Thread Malcolm Box
Hi, On one of my models, the admin choice_list page is taking minutes to load, which makes it somewhat broken. The table has about 2M rows and about 2.6GB in size, on InnoDB/MySQL. As far as I can tell, what's breaking things is the paginator code that is doing a SELECT COUNT(*) which is known

Re: Error installing permissions superuser when a userprofile has been defined

2011-03-23 Thread Malcolm Box
a superuser manually using ./manage.py shell, but would welcome any ideas on how to solve this better. Malcolm On Mar 23, 10:11 am, Malcolm Box <malcolm@gmail.com> wrote: > Hi, > > I'm running into an error when doing a syncb on a clean DB during the > installation of the

Error installing permissions superuser when a userprofile has been defined

2011-03-23 Thread Malcolm Box
Hi, I'm running into an error when doing a syncb on a clean DB during the installation of the auth system. I get the normal prompt "You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no):" and answer yes. But when

Re: Weird inconsistencies for same queryset in different Django instances

2010-05-11 Thread Malcolm Box
On Tue, May 11, 2010 at 8:27 PM, Daniel Roseman <dan...@roseman.org.uk>wrote: > On May 11, 7:08 pm, Malcolm Box <malcolm@gmail.com> wrote: > > Hi, > > > > I've run into a weird bug that has me scratching my head - I'm seeing > > inconsistent results

Weird inconsistencies for same queryset in different Django instances

2010-05-11 Thread Malcolm Box
Hi, I've run into a weird bug that has me scratching my head - I'm seeing inconsistent results from a queryset between various apache processes and the django shell. I.e. sometimes a GET gives me the right response (as it hits a "correct" Apache instance) and other times it gives a wrong

Re: Forcing HTTPS in admin

2010-03-01 Thread Malcolm Box
You could, but doing it on the front-end webserver makes more sense. Malcolm On Mon, Mar 1, 2010 at 3:02 PM, ozgurv wrote: > You can write a middleware that redirects users who visit admin > related pages (starts with /admin maybe) to HTTPS. > > On Mon, Mar 1, 2010 at 2:08

Re: Django REST and FILEFIELD field

2010-03-01 Thread Malcolm Box
I've got this working in the past, but only by writing custom create() methods on the Collection and Entry classes. In the custom create() method you can process the POST/PUT data directly into the FileField just like you would for a normal form Malcolm On Thu, Feb 25, 2010 at 7:03 PM,

Re: fixtures getting created with terminal message prefixed

2010-02-28 Thread Malcolm Box
I'll take a guess: one of your apps, middleware or possibly even a management command is generating this text. Grep for it in your source code, and remove/disable. Malcolm On Sat, Feb 27, 2010 at 4:34 AM, Russell Keith-Magee wrote: > On Sat, Feb 27, 2010 at 4:07 AM,

Re: ImageField admin preview not working

2010-02-28 Thread Malcolm Box
Read your settings.py file carefully: - you've said that the MEDIA_URL is / - but that Django is only configured to serve static content from /static So when the photo is uploaded, it's stored in /photos/x.jpg, which you've told Django is accessible via the URL /photos. But this gives

Re: How can I apply ordering through a M2M join model?

2010-02-28 Thread Malcolm Box
I don't know if you can do it directly using the ordering metadata - easiest way to find out is to try it and see. If not, I'd suggest a customer manager on the Gallery that returns the photos in order so that the line: Gallery.photos.all() refers to your customer manager that "does the right

Re: Django with Jquery

2010-02-28 Thread Malcolm Box
On Sun, Feb 28, 2010 at 5:39 PM, Alexis Selves wrote: > Hello, > I am totally helpless. I am trying to use JQuery in my django > templates, but I always get in firebug this: $ not defined. > Check with Firebug if the jquery script has been successfully loaded (using either

Re: simple, input from user and database earch result

2010-02-17 Thread Malcolm Box
On Wed, Feb 17, 2010 at 3:12 PM, gintare wrote: > > One more simple question: > > Is it possible that area which is used for data submission also can be > updated from python script. > It's not clear what you mean by this. The python (Django) script isn't running in the

Re: update with where clause constraints?

2010-02-06 Thread Malcolm Box
2010/2/5 Jared Smith > My use case is that I'll have multiple users trying to update a set of > objects and I want to make sure that any user committing a change has > knowledge of the existing state. I was going to model that with a version > number so an update would

Re: Problem with Last-modified header and Apache/mod_python

2010-02-05 Thread Malcolm Box
-Modified header based on the value from the database. Equally it doesn't produce any error either. The fix is simple - run some SQL to set all the last_modified fields to a recent date. Voila, the header appears. Hope this proves useful to someone in the future. Cheers, Malcolm 2010/2/2 Malcolm

Re: Speeding the code-test-debug cycle

2010-02-05 Thread Malcolm Box
Hi, Thanks for the suggestions. 2010/2/2 Phlip <phlip2...@gmail.com> > Malcolm Box wrote: > > > Has anyone got any ideas on how to speed this up - for instance, is there > a > > way to say "use an existing test database"? > > Per my other advice to

Speeding the code-test-debug cycle

2010-02-02 Thread Malcolm Box
Hi, As my django application has grown I'm noticing I'm spending longer and longer waiting for ./manage.py test to start up - ie create all the tables etc. Not helped of course by working on a laptop with a slow disk, as I suspect many of us do these days. This is slowing down my test-debug

Problem with Last-modified header and Apache/mod_python

2010-02-02 Thread Malcolm Box
Hi, I'm seeing a strange problem with Last-modified headers on my Apache/mod_python install. The problem being that they don't get sent. Running my django app locally, and using 'curl -v' to see the headers, I see correctly generated 'Last-modified' headers. When I deploy the same code to a

Re: REST & Django

2010-01-29 Thread Malcolm Box
On Fri, Jan 29, 2010 at 4:03 PM, pyleaf wrote: > how REST looks like in django? > does Django support REST defautly? > > Django can be used to develop a REST API, it implements all the HTTP methods needed and Django views can easily generate JSON, XML or whatever you

Making a model field have a default value

2010-01-27 Thread Malcolm Box
Hi, A question that's probably obvious but I can't quite see the best way to do it. I've got a model, call it Template, with some fields colour1, colour2 etc. What I want is that if there's a no value for the colourN field then a default value is returned when the field is read. Aha I hear you

Re: Reasons why syncdb ignores an application?

2010-01-27 Thread Malcolm Box
On Wed, Jan 27, 2010 at 6:54 PM, phoebebright wrote: > I cannot find the reason why syncdb will not create tables from a > models.py. > > It is quite happy to create the auth tables and ones from an external > app that is included in INSTALLED_APPS but it won't build

  1   2   >