CSS and JS minification

2010-09-20 Thread Shamail Tayyab
Hi, I've a working setup of a Django site at production. Now I want to minify CSS and JS (in-place). To deploy I've a git's post-receive hook, that can call a script to do this. I've seen a minification tool, but thats in Java. Any python/django specific minification program? Does the

REST XML + HTML API suggestions

2010-09-20 Thread Brendon
Hi all, I want to use DJango to implement an XML based RESTful API and a website together using DJango. I am wondering if anyone here is aware of any tutorials on ways of achieving this in DJango without duplicating too much code? Basically what I want to achieve is to use the same core logic

Testing with a non-model database

2010-09-20 Thread andrew cooke
Hi, I am using multiple databases. My main database is working fine in tests, but the database used by the standard Python OpenID library is causing problems because it is not defined via a Django model. The OpenID library provides a way to generate the database at the command line, but I

Re: multiple servers one database

2010-09-20 Thread Steve Holden
On 9/20/2010 11:11 AM, Tim Arnold wrote: > hi, I have two machines for a Django-powered site and they are setup > to be duplicates to provide redundancy. Each one runs its own apache > instance and accesses the same Django apps on a shared disk. > > The problem I have is that I need a single

Subclassing User class or User class "profiles" recommended for extra attributes?

2010-09-20 Thread Chris Seberino
Adding extra attributes to User classes seems to be handled originally by a "profiles". A new way seems to be to subclass the User class. One problem with the shiny new way is that lots of code is written to handle User classes instead of subclasses. The suggested way to fix this is nontrivial.

Re: process memory swelling during uploads

2010-09-20 Thread felix
I'm testing now with 6 WAV files (70M) all uploading at the same time and its not causing any problems. The process is up to 76M from its usual 70M. But this afternoon it gained about 1M a second up to 200M + My next suspect is Mutagen, though I've looked through the code and it appears to

process memory swelling during uploads

2010-09-20 Thread felix
I'm running Nginx front end proxying to Apache with mod_wsgi in Daemon mode. When uploading files the apache/django process is occasionally swelling up as though it were loading the whole file into memory. I've even removed the MemoryFileUploadHandler from the file upload handlers just to be

Re: Automatically creating fields

2010-09-20 Thread pixelcowboy
I get what you are saying, you are right in that it might make more sense to do it for every field that needs it. Thanks. On Sep 20, 11:22 am, Shawn Milochik wrote: > There are always ways. You could subclass models.Model and add the behavior, > if you read enough to

Javascript error on multiple choice widgets

2010-09-20 Thread wchildsuk
Hi, I'm trying to implement the same type of widget the admin interface has for many-to-many fields where you select the field and it moves across to the chosen list but on a non-admin page. I've tried implementing two quite different solutions this afternoon [1] but both have failed to work

Re: Emergency: Critical form error on medium-volume site

2010-09-20 Thread intrepidweb
Thank you so much, Xavier. I think that's it. A while ago I checked my template tags for thread safety, but somehow I missed one of them that deals with form formatting. I will let you know if the problems reappears. All the best, Leif On Sep 20, 10:09 am, Xavier Ordoquy

Re: Automatically creating fields

2010-09-20 Thread Shawn Milochik
There are always ways. You could subclass models.Model and add the behavior, if you read enough to understand how Django's models work. However, since you're only going create a model once (except migrations later), is it really going to save that much work? If you want to do it a quick &

Re: Proto-newbie needs Django for running an app, not for dev work

2010-09-20 Thread Tiger Technologies
Hi, I'm with Tiger Technologies (we saw this post -- a little late -- via a Google Alert). We are a shared hosting company, and that's why "sudo" didn't work. However, as Shawn mentioned, it is possible to use virtualenv to install a private copy of Django and other Python modules (we do have

Re: RSS Questions

2010-09-20 Thread Joel Davis
Thanks for trying it. And it works for me now. I guess google had to index it or something... I gave it 24 hours but I guess it needed more time. I thought the description had to be text. I'll try stuffing the html into there and see if it works. Thanks for your help! Joel On Sep 20, 8:17 am,

Re: Emergency: Critical form error on medium-volume site

2010-09-20 Thread Xavier Ordoquy
Hi, Are you sure you don't get a thread safety issue ? Do you have your own template tags for those forms ? Regards, Xavier. Le 20 sept. 2010 à 18:42, intrepidweb a écrit : > Hi all, > > Last week I ported a site that gets 50k+ pageviews/day from a PHP/ > mySQL stack to Django/Postgresql. It

Emergency: Critical form error on medium-volume site

2010-09-20 Thread intrepidweb
Hi all, Last week I ported a site that gets 50k+ pageviews/day from a PHP/ mySQL stack to Django/Postgresql. It has gone mostly smoothly, all things considered. However, I have encountered a VERY troubling bug involving the forms module, and I can't figure it out. The form in question allows

Automatically creating fields

2010-09-20 Thread pixelcowboy
Hi, for every field in a model that I have created, I want to create a releated boolean field. Is there any way to do this automatically? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: IE9 and dev server errors

2010-09-20 Thread TheIvIaxx
The server will hang once this occurs. Seems to only happen with ajax requests though. Also, when it occurs, if I go into Internet Options > Connection > LAN settings and simply hit Ok, then it finishes the request. I dont change anything, just open the settings and hit ok. No proxy stuff in

Re: RSS Questions

2010-09-20 Thread Nuno Maltez
Hi, I didn't have any problems subscribing to your blog with google reader from http://www.tapnik.com/ > > Secondly, I'd like to include the entire post in the RSS feed, not > just the description. Looking at other feeds, it looks like these are > stuffed into a "content:encoded" tag? Is that

Re: IPAddressField inserted as empty string although null=True

2010-09-20 Thread rihad
On Sep 20, 8:02 pm, Bill Freeman wrote: > I believe that this is documented. Yes, the docs do mention that string types like Char or Textarea should be using '' instead of NULL as a no-value option. But there really isn't such a value for Postgres' inet database type. Given

multiple servers one database

2010-09-20 Thread Tim Arnold
hi, I have two machines for a Django-powered site and they are setup to be duplicates to provide redundancy. Each one runs its own apache instance and accesses the same Django apps on a shared disk. The problem I have is that I need a single database. The users should not need to know which

Re: IPAddressField inserted as empty string although null=True

2010-09-20 Thread Bill Freeman
I believe that this is documented. I think that it's a limitation of forms that character fields store an empty result as a null string. All the null=True means is that the model field (not the model form field) is willing to send the database a null, should it find None in the instance

Re: list out of range error

2010-09-20 Thread Xavier Ordoquy
Hi, You are catching a KeyError while it throws and IndexError ;) Regards, Xavier. Le 20 sept. 2010 à 17:04, grimmus a écrit : > Hi, > > On the homepage of my website i list 1 random ad in the right column. > In my view i retrieve it like so: > > side_ad =

list out of range error

2010-09-20 Thread grimmus
Hi, On the homepage of my website i list 1 random ad in the right column. In my view i retrieve it like so: side_ad = SideAd.objects.filter(active=1).order_by("?")[0] If all ad's are inactive no object's will be returned thus creating an IndexError : list out of range I tried to wrap the above

django.db.utils.DatabaseError: value too long for type character varying(50)

2010-09-20 Thread Valentin Golev
Hello, I'm trying to deploy my Django application with PostgreSQL. While trying to insert an object to the database, I'm getting the following error: django.db.utils.DatabaseError: value too long for type character varying(50) My application were working fine on SQLite. I guess it has

TypeError: instancemethod expected at least 2 arguments, got 0

2010-09-20 Thread svintus
Django 1.1.2 & Python 2.6.5 I keep getting this error when executing a seemingly innocent queryset. Looks exactly like the issue described in http://code.djangoproject.com/ticket/7204 However, I'm running Django 1.1.2, which is supposed to have the fix for this bug. Has anybody dealt with

IPAddressField inserted as empty string although null=True

2010-09-20 Thread rihad
I have these fields in a model: ipaddr1 = models.IPAddressField() ipaddr2 = models.IPAddressField(blank=True, null=True) When I "wrap" this model in a ModelForm, fill the form, and call form.save(), empty ipaddr2 gets inserted as '', causing database errors for Postgres' inet

serialize dictionary problem

2010-09-20 Thread ashy
Hi All, I am having problem retrieving object in javascript. django function: def function cursor = db.cursor(cursorclass=MySQLdb.cursors.DictCursor) sql = "select * from .." dict = cursor.fetchall() return HttpResponse(simplejson.dumps(dict), mimetype='application/ json') javacript

Re: Possible to have dynamic drop down list in ModelForm?

2010-09-20 Thread Scott Gould
Two ways, both requiring javascript: 1. Populate the city dropdown via ajax on country change. 2. Have your template write javascript to do country->city lookups and alter the contents of the city dropdown on country change. On Sep 19, 2:42 am, Andy wrote: > I have a

What's the best way to develop an app that is similar the django admin?

2010-09-20 Thread Federico Capoano
Hi all, I try to explain it clearly. I have to develop an application that will implement similar functionality and look of the django admin, but in the frontend. So this application will have files management, clients management, and much more similar stuff, with add new, edit, delete, file

Re: overriding the admin's template sucks

2010-09-20 Thread Julian
thanks for that simple solution, but I'm very reluctant to do this, because putting template-logic in python-files reminds me of my PHP- days. nevertheless, it's a quick way to solve my problem. another problem will be to remove the admin-action-checkbox, because it's displayed even though I'm

Re: overriding the admin's template sucks

2010-09-20 Thread Daniel Roseman
On Sep 20, 11:54 am, Julian wrote: > Hi, > > I want to display a customized table for a model in the admin. I've > just written a customized filter, which works very well. > > The problem: My model has a field 'timestamp' which is a > datetimefield. It may be null, so in

overriding the admin's template sucks

2010-09-20 Thread Julian
Hi, I want to display a customized table for a model in the admin. I've just written a customized filter, which works very well. The problem: My model has a field 'timestamp' which is a datetimefield. It may be null, so in the admin it's displayed as '(None)'. I want to replace '(None)' with

Re: Django Chat App?

2010-09-20 Thread Sithembewena Lloyd Dube
Thanks Rod. Been away from office for a bit, but this is a good find indeed. Many thanks, once again. On Thu, Sep 16, 2010 at 11:05 PM, Rod Hamby wrote: > Linux opensource with many add ons. I have seen/done many things with this >

how should models be semi-related

2010-09-20 Thread Mike Dewhirst
I have an address model with a 'country' field and a phone model with a 'country_code' field. I would guess the right approach is to use choices for both fields so the user can always select or change country in an address AND country_code in a phone number. However, I would like the

Re: {% url %} template and javascript Get with callback

2010-09-20 Thread bruno desthuilliers
On 19 sep, 18:52, Ben Kraft wrote: > I'm trying to do a javascript post to an internal api and use a > callback to process the JSON result.  I'm referencing the api using, > > {% url %}, > > which returns a path url relative to my domain ( /api/... instead >

Re: Mutli-column composite keys

2010-09-20 Thread Danny Adair
On Mon, Sep 20, 2010 at 08:50, J. P. Smyth wrote: >[...] > Does anyone have a suggestion how I can achieve this unique primary > key in Django without resorting to creating another column with the > company name plus the product id? Unfortunately

Re: Mutli-column composite keys

2010-09-20 Thread Preston Holmes
On Sep 19, 1:50 pm, "J. P. Smyth" wrote: > Someone here wrote: > > "Mutli-column composite keys are not currently supported by Django. > Adding support for multi-column keys (primary or otherwise) is > something that has been long discussed, and there is