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 won

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 performance > and scala

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(): >file_instance = u

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 always been distinguishe

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 = models.ManyToManyField(Appointmen

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 there

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 instance. You probably

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: 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: https://docs.djangoproject.com/en/1.3//howto/custom-management-commands/

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): > > Image.open(self.image) > > super(SpectacleGall

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 management commands are what I want > > > > Strange enough, it seems that everyone sta

Re: Problem with relationships in models

2011-07-21 Thread Malcolm Box
his 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. > For more options, visit

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 bandwidth/CPU/memory to handle a significa

Re: [django] Get request URL

2011-08-03 Thread Malcolm Box
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: Django for a front end designer

2011-08-03 Thread Malcolm Box
ing 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 django-u

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 t

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

2011-03-23 Thread Malcolm Box
#x27;m just creating 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 wrote: > Hi, > > I'm running into an error when doing a syncb on a clean DB during the > installation of the aut

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 to

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 my project > settings.py. Th

Re: Admin broken with large data table

2011-03-29 Thread Malcolm Box
On Mar 29, 2:48 pm, Jacob Kaplan-Moss wrote: > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box wrote: > > 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,

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() t

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 execut

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

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 > wrote: > >> I'm confused by Django's behaviour when saving related models. Take for >> example: >> >> I kind of understand this,

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 = models.Foreig

Re: Aggregation / annotation over results of a subquery

2016-05-23 Thread Malcolm Box
ge.STATUS_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-aggregati

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. e.g.

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-09 Thread Malcolm Box
ntrib.admin.ModelAdmin.fields>, > just make sure you also override ModelAdmin.get_readonly_fields() > <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 Bo

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
it to Django 1.9 > which 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

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 > ge

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
e checks to check 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 sti

<    1   2