Re: Pre-empting Fixture execution in Django with nosetests.

2008-09-23 Thread Russell Keith-Magee
On Tue, Sep 23, 2008 at 4:07 PM, proteus guy <[EMAIL PROTECTED]> wrote: > Here's a fun one for you testing gurus! I have a Django app that uses an > irc server to communicate events to a system. My models utilize the django > model save signal to post an irc message when something is updated.

Re: Pre-empting Fixture execution in Django with nosetests.

2008-09-24 Thread Russell Keith-Magee
On Wed, Sep 24, 2008 at 4:39 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Russ, > > Well, as you can tell from my initial post, this was my initial > concept. However, you seem to be proposing to launch nosetests from > the 'manage.py test' execution rather than directly from the command >

Re: Test fixture persistent across applications

2008-09-24 Thread Russell Keith-Magee
On Thu, Sep 25, 2008 at 2:13 AM, davenaff <[EMAIL PROTECTED]> wrote: > > As it turns out, TestCase only flushes the database before a test. It > doesn't flush it after it has finished its tests. Correct. This is because your test suite can contain standard doctests and unittests, and these tests

Re: Whither Validators?

2008-09-24 Thread Russell Keith-Magee
On Thu, Sep 25, 2008 at 12:30 AM, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > > Validators (django.core.validators) seem to have been removed from > 1.0. What replaces them? Well... validators weren't ever really there to begin with. There was some initial stub code, but it wasn't fully integ

Re: Whither Validators?

2008-09-25 Thread Russell Keith-Magee
On Thu, Sep 25, 2008 at 8:52 PM, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > > Ok, so if I raiseValidationError in the save() methods, will this just > give a big fat ugly general error, or a cute "You have to provide your > complete credit card number" error? Well... it will do whatever you

Re: Comments in Django 1.0 (free comments?)

2008-09-25 Thread Russell Keith-Magee
On Fri, Sep 26, 2008 at 6:31 AM, Janmansilver <[EMAIL PROTECTED]> wrote: > > I have tried to implement comments in a blog I'm building with this in > my template: ... > In template /home/weiter/webapps/django_v1/lib/python2.5/django/ > contrib/comments/templates/comments/form.html, error at line 2

Re: Looking for an example on how to use us.forms.USZipCodeField

2008-09-27 Thread Russell Keith-Magee
On Fri, Sep 26, 2008 at 9:11 PM, Adam Stein <[EMAIL PROTECTED]> wrote: > > While there is are phone number and US state model fields, there doesn't > seem to be the equivalent zip code field, even though there is a zip > code form element. Not sure why that would be. Mostly an accident of histor

Re: admin.site.register breaks unittests

2008-09-27 Thread Russell Keith-Magee
On Sat, Sep 27, 2008 at 3:26 AM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Hi all, > > When I run my test suite, commands like these 'admin.site.register(Product, > ProductAdmin)' in models.py break my tests with this error: > > django.contrib.admin.sites.AlreadyRegistered: The model Product

Re: admin.site.register breaks unittests

2008-09-27 Thread Russell Keith-Magee
On Sat, Sep 27, 2008 at 9:54 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Russel, > > The example from the docs somehow doesn't work. I've turned on the > autodiscover but under admin it stays empty. I don't know if this is related, > but putting the register statements in urls.py does sto

Re: admin.site.register breaks unittests

2008-09-28 Thread Russell Keith-Magee
On Sun, Sep 28, 2008 at 4:39 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Russell, > > Is it correct to say that the admin.autodiscover statement should register > the models in 'myapp', and therefore I don't need the individual > admin.site.register statement for each model? No - that is

Re: trunk or 1.0?

2008-09-28 Thread Russell Keith-Magee
On Mon, Sep 29, 2008 at 7:27 AM, chiggsy <[EMAIL PROTECTED]> wrote: > > Just wondering if trunk is still stable? I've been using 1.0 and was > debating switching back to trunk. What is the best practice? Best practice depends on your requirements. Our intention is to keep trunk as stable as it h

Re: Set referer header in test client?

2008-09-29 Thread Russell Keith-Magee
On Tue, Sep 30, 2008 at 5:20 AM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm having a problem testing with: > > c = Client() >response = c.post('/guestbook/', { >'name' : 'name', >

Re: Q about a ticket and merging into svn

2008-10-02 Thread Russell Keith-Magee
On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm in need of the functionality of ticket #3672. I have de initial code > implemented. And there are some patches, but they seem to be diffs on files > in the main svn trunk. Yes - diffs against the sour

Re: Problems with dumpdata/loaddata

2008-10-02 Thread Russell Keith-Magee
On Thu, Oct 2, 2008 at 9:35 PM, Gary Thomas <[EMAIL PROTECTED]> wrote: > > I'm trying to use the admin interface to dump & restore my database, > without much luck. I can dump the data fine, but I've had no success > loading it back in. > > Could someone list the commands to do this? The actual

Re: Q about a ticket and merging into svn

2008-10-03 Thread Russell Keith-Magee
On Fri, Oct 3, 2008 at 5:13 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > I examined the svn tree and the patches. It seems that the diffs are for the > widget.py file under 'newforms', but this directory does not exist in the svn > tree. I've tried appending the widget classes from the tic

Re: SQL: Migration How To?

2008-10-03 Thread Russell Keith-Magee
On Sat, Oct 4, 2008 at 12:36 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > Is there somewhere a place in the documentation where SQL migration > strategies are explained a little? > I think I remember a paragraph in the pre-1.0-documentation that > described what you have to do with your databa

Re: select_related and intermediary tables

2008-10-03 Thread Russell Keith-Magee
On Sat, Oct 4, 2008 at 5:34 AM, Robert <[EMAIL PROTECTED]> wrote: > > I've been banging my head against this problem for several days now, > and have decided to ask for help. I've read the Django DB API and > searched this mailing list. > > Assuming the following models: > > http://dpaste.com/822

Re: Admin UI: How to auto select selectbox items via URL?

2008-10-05 Thread Russell Keith-Magee
On Mon, Oct 6, 2008 at 7:06 AM, Dana <[EMAIL PROTECTED]> wrote: > > On Sep 18, 2:16 pm, Dana <[EMAIL PROTECTED]> wrote: >> Im confused as to why I cannot select items above 9 and if this issue >> is fixed in Django 1.0? Could someone test it on 1.0 and let me know? >> Also, if you know how to get

Re: Django Coding Style and PEP 257

2008-10-06 Thread Russell Keith-Magee
On Sat, Oct 4, 2008 at 1:03 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I see that > http://docs.djangoproject.com/en/dev/internals/contributing/#coding-style > prefers docstrings like """Calculates something and returns the > result.""" to those like """Calculate something and return th

Re: dynamic associations?

2008-10-06 Thread Russell Keith-Magee
On Tue, Oct 7, 2008 at 5:53 AM, Alex G <[EMAIL PROTECTED]> wrote: > > Dear django-users, > > Does anyone know of a way to dynamically create an object related to a > model whose name is not known until runtime? Essentially, I have a > situation wherein I need to create this associated object, but

Re: Can this be solved without hardcoded SQL?

2008-10-06 Thread Russell Keith-Magee
On Tue, Oct 7, 2008 at 9:46 AM, Alex Ezell <[EMAIL PROTECTED]> wrote: > > On Mon, Oct 6, 2008 at 6:36 PM, Kasper Grubbe <[EMAIL PROTECTED]> wrote: > >> I have a date in my database. And i want to list all years and months >> in that, without duplicates. > >> I can get the data out without duplicat

Re: dynamic associations?

2008-10-08 Thread Russell Keith-Magee
On Tue, Oct 7, 2008 at 9:59 PM, Alex G <[EMAIL PROTECTED]> wrote: > > Ah, it works for me too, except in the case of relations. > > Essentially, it all comes down to one line of code; given an instance > model, a method as a string, and a secondary instance of a model, > something like: > > getatt

Re: viewdoesnot exist at /

2008-10-10 Thread Russell Keith-Magee
On Fri, Oct 10, 2008 at 3:14 PM, Arnoud Tijssen <[EMAIL PROTECTED]> wrote: > > Exception Type: ViewDoesNotExist at / > Exception Value: Could not import surftrackr.log.views. Error was: cannot > import name newforms Looks like you're using Django v1.0, but you're using code that hasn't been updat

Re: viewdoesnot exist at /

2008-10-10 Thread Russell Keith-Magee
On Fri, Oct 10, 2008 at 3:34 PM, Arnoud Tijssen <[EMAIL PROTECTED]> wrote: > > I`m using django 1.1 pre-alpha SVN-9218 and according to surftrackr it was > best to use the latest django version from subversion. It sounds like they need to update either their advice or their code - preferably both

Re: Syncdb Command

2008-10-11 Thread Russell Keith-Magee
On Sat, Oct 11, 2008 at 3:01 PM, Hingarajiya,Ravi <[EMAIL PROTECTED]> wrote: > Hi All, > > I want to know that how to run syncdb command using command line arguments > as site-username, password and email id. > >Example : python manage.py syncdb > > > I don't want to insert site-usern

Re: Newbie Forms Question

2008-10-11 Thread Russell Keith-Magee
On Sat, Oct 11, 2008 at 8:05 PM, d. <[EMAIL PROTECTED]> wrote: > > Probably a simple, stupid error I'm making: > > I try to display a form in a template using: > > > {{ rForm.as_table }} > > > > > The browser displays pure html of the form content, having the form- > source all escaped to som

Re: Get m2m id to update the m2m model.

2008-10-12 Thread Russell Keith-Magee
On Mon, Oct 13, 2008 at 5:27 AM, xkill <[EMAIL PROTECTED]> wrote: > > Hello, > > I try to update a m2m relation. > > So this is the problem: > > models.py > --- > from django.db import models > > class instruments(models.Model): >name = models.CharField(max_length=10) > > class peo

Re: Making queries guide, incomplete code.

2008-10-15 Thread Russell Keith-Magee
On Wed, Oct 15, 2008 at 4:19 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > > On 15 oct, 01:57, KillaBee <[EMAIL PROTECTED]> > wrote: >> On Oct 14, 4:52 pm, bruno desthuilliers >> > (snip) >> Check, I have read the lovely guide, and Didn't have to know real >> Python until now. > > IOW : cop

Re: How to parse an XML file with django.

2008-10-15 Thread Russell Keith-Magee
On Thu, Oct 16, 2008 at 6:27 AM, JFQueralt <[EMAIL PROTECTED]> wrote: > > Hi, there. > > Being a newbie in django maybe I am just missing something but I don´t > seem to find any information about how to retrieve an XML file and > parse it from django. Remember - Django isn't a programming langua

Re: How to parse an XML file with django.

2008-10-16 Thread Russell Keith-Magee
On Thu, Oct 16, 2008 at 3:56 PM, kang <[EMAIL PROTECTED]> wrote: > If you want to parse xml, I recommend feedparser. > > http://www.feedparser.org/ > > wish it helps You may wish to be a little bit careful giving out advice like that. Feedparser is a parser for... wait for it... feeds. All feeds

Re: Django events

2008-10-16 Thread Russell Keith-Magee
On Thu, Oct 16, 2008 at 5:31 PM, Daniele Procida <[EMAIL PROTECTED]> wrote: > > How easy would it be to set up something on, or connected to, Django People? Django People is very useful, but it isn't an 'official' Django resource. It's just something that a member of the Django community has cont

Re: URL handling and porting from 0.96 to 1.0

2008-10-18 Thread Russell Keith-Magee
On Sat, Oct 18, 2008 at 6:10 PM, Philippe Raoult <[EMAIL PROTECTED]> wrote: > > Hello all, > > I've starting porting my little app (20k loc) from 0.96 to 1.0 and > I've been hitting a wall of reverse/url errors. I haven't seen > anything in the porting wiki page so I'm wondering if anyone has > al

Re: alternative for foreignkey fieldset

2008-10-18 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 2:40 AM, Low Kian Seong <[EMAIL PROTECTED]> wrote: > Dear all, > > Is there another form the foreignkey field can take besides the dropdown? I > mean if there are 10,000 enteries for a particular foreign key and I am not > using the admin interface won't it slow things down

Re: Simplest unit testing of models fail ...

2008-10-18 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 4:00 AM, Ian J Cottee <[EMAIL PROTECTED]> wrote: > > Given a backend of postgres and a simple test to test that, for > example, your model does not accept fields with more characters than > it should ... how do you do it? > > I have a part database which has two fields - co

Re: Json Serialization / Form Validation error

2008-10-18 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 12:58 AM, justind <[EMAIL PROTECTED]> wrote: > > Hello, > > No one has any ideas? Settle down, Tiger. You asked this question on a Friday night. You may need to wait a little more than 18 hours if you want a response. We're all volunteers here, and many of us have professi

Re: Questions on packaging a project and naming conventions

2008-10-19 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 5:53 AM, Dana <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > I am working on a CMS that includes a bunch of applications (like > Story, Event, etc...) with some being propriatary and some being third > party. When it comes to our naming conventions, we've had a bit of >

Re: middleware or view ?

2008-10-19 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 5:19 AM, PonasNiekas <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm about to write an app, which is going to do long running (~1 to > ~60 minutes) calculations (meanwhile, the user who triggered the > calculation will get message like "calculation in progress" or smth). > > I'm

Re: middleware or view ?

2008-10-20 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 7:27 PM, PonasNiekas <[EMAIL PROTECTED]> wrote: > > Thanks Russ for the replay. Your idea would certainly work and I agree > that > doing calculations outside django/web server makes sense. I will > probably > and up doing the way you described. > > On the other hand, havin

Re: Simplest unit testing of models fail ...

2008-10-20 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 5:06 PM, zobbo <[EMAIL PROTECTED]> wrote: > > When a test fails and another test then runs, it dies because the > transaction is in error. The field with too many chars fails and that > causes the next test to raise an error. If you switch the backend to > SQLLite for exam

Re: alternative for foreignkey fieldset

2008-10-20 Thread Russell Keith-Magee
On Mon, Oct 20, 2008 at 1:50 AM, Low Kian Seong <[EMAIL PROTECTED]> wrote: > Just curious but has anyone done this is a production environment? Used raw_id_fields? Written a custom widget and used it in the admin? In my case, yes to both questions - although I'm not sure of the significance of a

Aggregates come to Django

2009-01-15 Thread Russell Keith-Magee
Hi all, For those watching trunk, revision 9742 added aggregate support to Django. (Yay!) The short version is that Querysets now have two additional operations - annotate() and aggregate(). For details on how to use these new operations, see the documentation: http://docs.djangoproject.com/en/

Re: Traceback in the ``runserver`` console

2009-01-18 Thread Russell Keith-Magee
On Sun, Jan 18, 2009 at 8:25 PM, Simon Forman wrote: > > On Dec 27 2008, 5:14 am, "Russell Keith-Magee" > wrote: >> On Sat, Dec 27, 2008 at 2:32 AM, Fridrik Mar Jonsson >> wrote: >> >> > I recently had an instance where it would have been

Re: How do i display a count of items related to a model?

2009-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2009 at 10:37 PM, Gath wrote: > > In Django how can i return the total number of items (count) that a > related to another model, e.g the way stackoverflow.com does a list of > questions then on the side it shows the count on the answers related > to that question. > > This is eas

Re: Setting a field based on foreign key data

2009-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2009 at 10:57 PM, jason.t.stein wrote: > > Perhaps this is an sql question, and not a Django question so please > have patience. I am writing a student management app that keeps track > of student events. The relevant tables are: > > class Student(models.Model): > first_name = mo

Re: Fixtures in production use - best practices

2009-01-22 Thread Russell Keith-Magee
On Fri, Jan 23, 2009 at 5:31 AM, Delta20 wrote: > > Fixtures are geared towards unit testing; I'm wondering if they are > considered a good way to populate the database with some initial > default values. > > For example, say we have a model TicketState, and the applications > must be guaranteed

Re: Comparing values from multiple tables; *show new posts* forum feature

2009-01-23 Thread Russell Keith-Magee
On Fri, Jan 23, 2009 at 4:19 PM, Piotr Husiatyński wrote: > > On 18 Sty, 12:06, Malcolm Tredinnick wrote: >> Wait a few days until ticket #7210 is resolved and you'll be able to use >> references to other fields as rhs values in filters. The work for that >> is nearly complete, so it's pretty cl

Re: Adding a slug

2009-01-24 Thread Russell Keith-Magee
On Sun, Jan 25, 2009 at 2:14 AM, Adi Sieker wrote: > > Hi, > > as far as I know loaddata doesn't use the ORM to insert the data. Incorrect. loaddata does use the ORM, but it uses raw save mode, which disables custom save methods. Raw save mode also disables any database field pre-handling, such

Re: How to access mail.outbox

2009-01-25 Thread Russell Keith-Magee
On Mon, Jan 26, 2009 at 12:20 AM, Oleg Oltar wrote: > Hi! > I am trying to write nose tests for my django application. One of the points > is to check if > emails are sent properly. > The suggested in the doc > way(http://docs.djangoproject.com/en/dev/topics/testing/#django.core.mail.django.core.

Re: Django docs and automation tests

2009-01-25 Thread Russell Keith-Magee
On Mon, Jan 26, 2009 at 12:32 AM, Oleg Oltar wrote: > Hi! > Can you please explain me idea of testing django applications with Client() > There many examples in doc, where test cases just checked the > response.status_code == 200, > But I am often getting 302 instead of 200. Is there any workarou

Re: Multithreaded development server

2009-01-25 Thread Russell Keith-Magee
On Sun, Jan 25, 2009 at 10:45 PM, Almad wrote: > > For those interested, patch from #3357 works nicely and can be started > from within: > http://devel.almad.net/trac/django-sane-testing/changeset/d2c24247d7e4 > > However, it's still buggy for my case. If You want it too, You can use > CP WSGI a

Re: XML Serialization Speed

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 12:35 AM, Taylor wrote: > > Okay, that makes sense. Thanks for the link to Python timing! > > Can anyone familiar with the internals of django's serialization and > templating offer any suggestions? My suggestion is this: Try it. I can't say I've ever done a comparative

Re: GROUP BY

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 10:55 AM, Glenn Maynard wrote: > > How are aggregates grouped on anything other than a simple column? I'm a little bit confused as to what you think is happening here - what do you mean by "other than a simple column"? The default aggregate grouping is effectively by obje

Re: GROUP BY

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 1:20 PM, Glenn Maynard wrote: > > On Jan 26, 10:20 pm, Russell Keith-Magee > wrote: >> I'm a little bit confused as to what you think is happening here - >> what do you mean by "other than a simple column"? The default >> a

Re: Multithreaded development server

2009-01-27 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 11:21 PM, Almad wrote: > > P.S.: Sorry for the sarcastic tone of my e-mail. I appreciate Your > work as well as Django framework (or at least some parts of it), but I > just don't get it: for each and every project I've written in Django, > I banged my head against the wal

Re: Creating test databases. Nose framework

2009-01-27 Thread Russell Keith-Magee
On Wed, Jan 28, 2009 at 5:51 AM, Oleg Oltar wrote: > Hi! > I am trying to create few nose test for my application. > I need to test registration/login, so want to create a test sqlite3 > database, and pre-populate it with some data. > No sure how to do it. > I created a setup method: > def setup(

Re: About django validation system

2009-01-28 Thread Russell Keith-Magee
On Wed, Jan 28, 2009 at 8:45 PM, Matias Surdi wrote: > > Shouldn't validation be defined in the modell instead of the forms? There are cases where form validation is the right thing to do - for example, if you have a web form that isn't backed by a model. However, there is certainly a good argum

Re: Changing database fields

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 6:53 AM, Mark Jones wrote: > > This is where Rails rocks and DJango doesn't. I haven't been able to > find any kind of DB Migrations in Django like those in Rails. Sad > too, because other than that, Python is a lot nicer than Ruby (Syntax > wise for an old C++ programme

Re: ContentTypes and fixtures

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:36 AM, Oliver Beattie wrote: > > How can I be sure that the ContentType IDs are always constant, and > therefore my data in fixtures is guaranteed to always point to the > right object? Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-) This is an annoying bug th

Re: Improving the response time in Django Admin

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:41 AM, Tipan wrote: > > Can anyone suggest some areas to explore to improve the response time > on the Admin. We're currently on release 7476 (pre new forms admin), > but due to go to the latest development release next week, although > I'm not sure how significant this

#7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
Hi all, With [9792], I've committed F() query expressions to trunk. For details, see the docs: http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model There are two caveats worth knowing about: 1) This patch reveals a bug in the SQLite package that shi

Re: #7210 - F() Query Expressions

2009-01-29 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 2:47 AM, koenb wrote: > > This is really great! Thanks all for the good work. > > Just curious, has there been any work done to make this also work for > dates ? > > like in > > longevents = Event.objects.filter(enddate__gte=F('startdate')+10) As committed, the expression

Re: #7210 - F() Query Expressions

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:59 PM, koenb wrote: > >> As committed, the expressions framework is fairly dumb - it is really >> just a way to do two things: >> 1) Expand Django-style field references into column names (and joins >> if required) >> 2) Turn Python expression trees into SQL expression

Re: guidance on serialization

2009-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2009 at 7:30 AM, Jason Geiger wrote: > > Hello all. Say I have some models like these: > > class Image(models.Model): >file = models.ImageField(upload_to=get_image_path) > > class Line(models.Model): >image = models.ForeignKey(Image) >color = models.CharField(max_lengt

Re: "invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 12:44 AM, omat wrote: > > Hi all, > > I obtain a list of tag ids by: > tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max > ('added'))[:10] > > and try to use it in the following query to obtain tag objects: > Tag.objects.filter(id__in=tag_ids) > > But

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 9:53 PM, Konstantin wrote: > > On Feb 1, 2:23 pm, Russell Keith-Magee wrote: >> Yes. Read up on how to use the save() method in the modelforms docs. >> >> http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-sav... >> >>

Re: Someone using django trunk for production?

2009-02-01 Thread Russell Keith-Magee
On Sat, Jan 31, 2009 at 7:24 PM, Alessandro Ronchi wrote: > > I need to use aggregation features of django 1.1 (i need AVG, SUM). > > My production site uses 1.0.2. > > Can I upgrade to trunk without worrying? Would I expect to see any major failures? No. Would I keep my eyes open just in case?

Re: Using ./manage.py test without a database and with a custom test runner fails

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 7:42 PM, Jarkko Laiho wrote: > >> The doc about defining a different test runner starts with the assumption >> you are not using Django's test framework -- I read that to mean you are not >> using django.test.TestCase tests, for example. You can't just rip out the >> datab

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 8:12 PM, Konstantin S wrote: > > Hello! > > I couldn't add m2m relations in my form if I use delayed commit, i.e. > form.save(commit = False) and form.save() later on. See code at > http://dpaste.com/hold/115253/. Is there some common pattern to > workaround such issues ?

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-02 Thread Russell Keith-Magee
On Mon, Feb 2, 2009 at 4:46 PM, omat wrote: > > I just remembered that the above error occured when running on > Postgresql 8.2. Sorry for the misinformation about SQLite. > > Then to give it a try with SQLite, I built a fresh database with > syncdb on SQLite. > > This time, at the same point, I

Re: Custom Aggregate Objects

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:16 AM, alex.gay...@gmail.com wrote: > > On Feb 2, 9:05 pm, nsitarz wrote: >> Hey, >> >> Back when the ORM aggregate support was a patch in trac I used to >> create custom aggregate objects that looked like this: >> >> class Date(Aggregate): >> pass >> >> class DateH

Re: Custom Aggregate Objects

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 8:34 PM, Russell Keith-Magee wrote: > On Tue, Feb 3, 2009 at 11:16 AM, alex.gay...@gmail.com > wrote: >> >> On Feb 2, 9:05 pm, nsitarz wrote: >>> Hey, >>> >>> Back when the ORM aggregate support was a patch in trac I use

Re: How do you serialize a model that has a common base model

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:24 PM, souper wrote: > > Then if I try: > all_objects = list(BurgerStand.objects.all()) + list(Place.objects.all > ()) > data = serializers.serialize('xml', all_objects) > > I get all Place objects - even the ones that are not related in any > way to BurgerStand. Which

Re: Django contrib apps in different db schema

2009-02-03 Thread Russell Keith-Magee
On Tue, Feb 3, 2009 at 11:26 PM, haestan none wrote: > Hi, > > I'm trying to use Django for implementing new stuff in some of our legacy > apps. > All the existing apps use PostgreSQL as their database backend. Now in order > to > do this as transparent as possible, I'd like to use a different da

Re: #django community etiquette observations

2009-02-03 Thread Russell Keith-Magee
On Wed, Feb 4, 2009 at 2:16 PM, Kenneth Gonsalves wrote: > > On Wednesday 04 Feb 2009 1:57:46 am sierramtns wrote: >> there are certainly other people acting as such in varying degrees, >> and i only cite Magus- because of the twitter feed and django log >> entry being available to exemplify this

Re: syncdb dry run

2009-02-04 Thread Russell Keith-Magee
On Wed, Feb 4, 2009 at 11:57 PM, tow wrote: > > Is there a way to do a dry run of "manage.py syncdb", to see what sql > commands it's about to execute? > > "./manage.py sqlall" isn't good enough for my purposes because > > 1) I have to specify the list of applications myself > (although it's easy

Re: Django Templates: Dynamically addressing 2-D Dictionary

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 7:30 AM, Glen Jarvis wrote: > > Notice that I can reference grants.2.63 through direct reference, but > when trying to use the variables alpha=2, and beta=63, this lookup > fails. Yes - it will. > I'm beating my head up against the wall with this. Could anyone send > me s

Re: Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:39 AM, bbeaudreault wrote: > > Sorry to spam, but in re-reading my post I realized that I assumed > people know what I mean by "Shared Code." That's not the unclear bit. The unclear bit is your terminology and how your are interpreting it. What, exactly, is a "Django han

Re: Serialization

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:35 AM, issya wrote: > > My ideal situation would be to initially load the data through ajax > and update through ajax. But I cannot find an easy way to do this. If > I searialize the data, I don't see an easy way to deserialize it. Are you aware of the following: http:/

Re: Serialization

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 1:09 PM, issya wrote: > > Thanks for the reply. I was aware of that but I guess I don't > understand how to go about using it. I do understand that I can > serialize a queryset. But I cannot just go and use the serialized data > as template context. From the options I've se

Re: [slightly offtopic] Which Python are people using on OSX?

2009-02-05 Thread Russell Keith-Magee
On Fri, Feb 6, 2009 at 6:07 AM, cjl wrote: > > I've been on Windows and Linux for many years, and recently picked up > a Macbook Pro for the fun of it. > > To be honest, I'm kind of disappointed with the Python included with > Leopard. I spent some time googling around to see what my options are

Re: Converting queryset filter() strings to their fields?

2009-02-06 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 5:05 AM, Ben Gerdemann wrote: > > My question is how, can I can get a reference to the 'a21_ano' field > that this filter is referencing? If the filter didn't span through the > foreign key, I could just do: > > T60Curso._meta.get_field("ex") > > but this doesn't work: > >

Re: Best Practices for filter()[0] and get()

2009-02-06 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 8:14 AM, Michael Burton wrote: > I often have a need to get an object that I don't know for sure is in the > database. For example, > > Retrieving a person by username when the username may have been mistyped, > eg. User.objects.get(...) > Retrieving a user's most recently

Re: Modify label from field.label_tag

2009-02-07 Thread Russell Keith-Magee
On Sat, Feb 7, 2009 at 6:03 PM, Kless wrote: > > Does anybody could help me with this? First off - please be patient. You've waited less than a day for a response. Sometimes it will take a day or two to get a response - especially when you ask your question on a Friday night. As for your questi

Re: optional foreign key

2009-02-07 Thread Russell Keith-Magee
On Sun, Feb 8, 2009 at 8:03 AM, J wrote: > > The idea is to be able to query all the items that have a specific 'group' > record chosen, as well as all items that don't have anything set. Since some > of them can be NULL or None, how do I go about selecting in a query both the > items that are NU

Re: Modify label from field.label_tag

2009-02-07 Thread Russell Keith-Magee
On Sun, Feb 8, 2009 at 7:08 AM, Kless wrote: > > Thanks Russel for your fast reply. > My answer is down > > On 7 feb, 10:05, Russell Keith-Magee wrote: >> On Sat, Feb 7, 2009 at 6:03 PM, Kless wrote: >> >> > Does anybody could help me with this? >>

Re: Exception in Django's Exception Handling

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 4:20 AM, Devel63 wrote: > > Django is raising an exception while trying to process an exception, > resulting in no stack traces ... for many different types of errors. > > It has the problem in debug.py, at this line under > technical_500_response: >return HttpResponseS

Re: Adding project revision number to templates.

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 8:17 AM, Dana wrote: > > Hi all, > > Wondering what the best approach would be to add my projects revision > number to my projects admin? I would like to show the revision number > of my SVNed project in my admin templates so I can easily see what > version each client is r

Re: protect from brute force attacks on login

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:21 PM, Markos Gogoulos wrote: > Hi all, > > I'm using django-registration to handle logins, registrations etc. It is > very handy and easy to set up, but allows unlimited login attempts, and thus > people can brute-force any django-application! > > So far I've been using

Re: Troubles with unicode in django-trunk

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:58 PM, jfmxl wrote: > > Hello, > > I downloaded the 1.0.2 version of django to my ubuntu 8.10 box and > began the tutorial. I got as far as adding the unicode print > definitions for poll and choice, and then saw no difference between > afterward : > > In [2]: Poll.object

Re: mod_python vs. Django?

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 6:54 PM, Vincent wrote: > > Hello > > I'd like to write a Web 2.0-type web application. I find Python a lot > more pleasurable than PHP. > > I'd like to have information about the pro's and con's of using > Apache's mod_python vs. an application server like Django, Turbogea

Re: Troubles with unicode in django-trunk

2009-02-09 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 8:43 PM, jfmxl wrote: > > On Feb 9, 5:21 pm, Russell Keith-Magee wrote: >> On Mon, Feb 9, 2009 at 6:58 PM, jfmxl wrote: > Sorry, I am new to python and I guess you hadn't bothered to read the > elementary tutorial that I was following. I should ha

Re: Exception in Django's Exception Handling

2009-02-09 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 1:59 AM, Devel63 wrote: > > I'll see if I can extract some small subset and post the details. > > In the meantime, more info: the problem only occurs when an error is > encountered during a call in which the server will return a > HttpResponse('', mimetype='text/xml; chars

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 4:21 PM, igorlash wrote: > > Hi everybody. > I'm java developer , and I like comparing web frameworks. > Members of django community talk a lot about easiness of django > especially comparing with java frameworks. But they have not compared > all aspects. And I want to com

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 6:47 PM, Alessandro Ronchi wrote: > I have to get the max value of a model grouped by a field. > > The RAW SQL query is this: > > SELECT max(energy_tot) FROM fotovoltaico_modules,fotovoltaico_module_scheme > WHERE fotovoltaico_module_scheme.plant_id = 3 AND > fotovoltaico_

Re: Group By and aggregation

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:43 PM, Alessandro wrote: > > > 2009/2/10 Russell Keith-Magee >> >> >> However, if you're using Django trunk, what you want is: >> >> >>> from django.db.models import Max >> >>> qs = >

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 6:52 AM, Greg Ewing wrote: > > Alex Gaynor wrote: > >> As I said above, a checkout of the django source includes all the docs, >> which can be built into nice HTML just as online with the sphinx module >> for python. It takes all of 30 seconds. > > Only if you have all th

Re: comparisons with java framework

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 8:41 PM, igorlash wrote: > > The django community should allow to download html version of > documentation to make this project more attractive , I'm sure it > doesn't take a lot of time to generate it on configured environment. You're sure, are you? Have you actually wri

Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 4:24 PM, igorlash wrote: > > Russ Magee , I've got a question personally to you. > Why do we need to use make ? Why this build can't be done without make > but only with python ? A lot of companies try to avoid using make and > moving projects to python as build tool. Mak

Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 8:09 PM, igorlash wrote: > > But if you take a look at Makefile you will find that this file has > only creating folders and running processes. So make isn't used as > real build tool in django. If this is what you believe, then you either don't understand what make does,

Re: Really slow functional tests

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 10:11 PM, Andrea Reginato wrote: > > On Feb 11, 1:59 pm, felix wrote: >> do you have large initial_data fixtures ? >> >> tables get flushed and initial_data is added each time. > > Yes, looking at it it's quite huge, and if it's loaded each time for > sure that is the pro

<    1   2   3   4   5   6   7   8   9   10   >