Re: comparisons with java framework

2009-02-11 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 12:06 AM, Andrew Ingram wrote: > > 2009/2/11 Alex Gaynor : >> This is another case of generating work for someone as far as I can tell, >> sphinx autogenerates the make file for us, we didn't write it. To switch to >> some other system means to rewrite work that we didn't

Re: Thoughts on nested Model references and JSON serialization

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net wrote: > > I wanted to get the communities thoughts on this subject. I am > working on a simple site that has news articles, each of which has a > reference to a User object provided by django.contrib.auth that is the > author of the n

Re: Group By and aggregation

2009-02-13 Thread Russell Keith-Magee
On Fri, Feb 13, 2009 at 6:54 PM, Alessandro wrote: > > > 2009/2/10 Alessandro >> >> >> 2009/2/10 Russell Keith-Magee >>> >>> >>> i.e., plural modules, not singular module, in the Max lookup. It's the >>> reverse lookup name fo

Re: load huge dataset through fixtures

2009-02-16 Thread Russell Keith-Magee
On Mon, Feb 16, 2009 at 7:42 PM, Konstantin S wrote: > > Hello! > > I am trying to load really huge dataset (contains millions of records) > into database through fixtures and it seems that django loads entire > data into memory before commiting it into db so python process dies > out of memory.

Re: Settings for an application - define as a model?

2009-02-16 Thread Russell Keith-Magee
On Tue, Feb 17, 2009 at 6:24 AM, Rob wrote: > > I'm writing a Django app to act as the front-end interface to a backup > application, using MySQL as the database. I need to store some > variables to act as the "global" settings specific to my app - like > UNIX backup location, etc. > > At present

Re: You don't have permission to edit anything - new forms admin

2009-02-17 Thread Russell Keith-Magee
On Wed, Feb 18, 2009 at 2:17 AM, Rajesh Dhawan wrote: > > >> >> # Admin: >> ('^hiveadmin/(.*)', admin.site.root), > > > That's no longer the right way to hook the admin into your URL conf. > See here: > > http://docs.djangoproject.com/en/dev//ref/contrib/admin/#hooking-adminsite-instance

Re: Struggling with annotations / aggregations

2009-02-18 Thread Russell Keith-Magee
On Thu, Feb 19, 2009 at 2:32 AM, Stefan Tunsch wrote: > > Hi there! > > I'm trying to see what's the best approach in my scenario. > The problem is how to make a list display different sums and > calculations based on it's child objects. > > My scenario could be the following: > Two models: Proje

Re: MetaWeblog API vs. Atom Publishing Protocol support

2009-02-19 Thread Russell Keith-Magee
On Thu, Feb 19, 2009 at 7:45 PM, Gour wrote: > Hi! > > I'm new to Django exploring what can be done with it and I'd like that > blog users could use some of desktop blog clients to publish their posts > to Django-powered blog site, so I did some research about support for > MetaWeblog and Atom PP

Re: Aspect Orientation?

2009-02-19 Thread Russell Keith-Magee
On Fri, Feb 20, 2009 at 1:04 AM, RaoB wrote: > > Is anything being done to include aspect orientation in dJango, to be > able to easily and dynamically modify behaviors etc.? > http://www.cs.tut.fi/~ask/aspects/download.shtml seems interesting? In short - no. If you have any specific suggestion

Re: grouping save() queries into a single query

2009-02-20 Thread Russell Keith-Magee
On Sat, Feb 21, 2009 at 12:08 AM, Alessandro Ronchi wrote: > > is it possible to group different model save() to avoid the > multiplication of db connections and queries? > > I need to make a lot of save() of different new models and it should > be very useful to find a way to group them and comm

Re: checking if db is empty

2009-02-25 Thread Russell Keith-Magee
On Thu, Feb 26, 2009 at 4:24 AM, knight wrote: > > Hi, > > I'm using postgres database in my Django application. > Is there a way to check if the database is empty from my models.py? (I > mean before the first syncdb) There isn't a simple 'is_my_database_empty' command that returns true/false. H

Re: How to select a single field from database with django QuerySet API?

2009-02-26 Thread Russell Keith-Magee
On Thu, Feb 26, 2009 at 7:23 PM, marco sedda wrote: > > Hi, >   I want to select a "single" field from a table, i've read the > QuerySet API reference but i can't find anything to solve my query. > > Just to explain: > > If i've a table like: > > User >   first_name = models.CharField(max_length=

Re: Undocumented comment setting

2009-02-27 Thread Russell Keith-Magee
On Fri, Feb 27, 2009 at 8:02 PM, Chris McCormick wrote: > > Hi, > > The COMMENTS_ALLOW_PROFANITIES setting is undocumented at > http://docs.djangoproject.com/en/dev/ref/contrib/comments/settings/ A known omission, with a purpose: http://code.djangoproject.com/ticket/9530 http://code.djangoproje

Re: Undocumented comment setting

2009-02-27 Thread Russell Keith-Magee
On Fri, Feb 27, 2009 at 11:59 PM, Tim Chase wrote: > >>> The COMMENTS_ALLOW_PROFANITIES setting is undocumented at >>> http://docs.djangoproject.com/en/dev/ref/contrib/comments/settings/ >> >> A known omission, with a purpose: >> >> http://code.djangoproject.com/ticket/9530 >> http://code.djangop

Re: Appropriate placement for my testcases belonging to a non-app in Django

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 10:10 PM, madhav wrote: > > I have built my website in Django. And like any other django project I > have got apps inside the project root directory and some special > folders like(extensions a.k.a custom django command extensions). With > an app, we dont have any problem w

Re: New to Django and a few basic questions

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 9:54 PM, ch...@secondfoundation.net wrote: > > Hi group, > > as the subject says, I'm new to Django. I worked through some > tuturials and djangobook.com for the 1.0.2 version as far as there > already is documentation. Anyway, I'm still not certain Django is the > right an

Re: Custom filter() operators

2009-03-05 Thread Russell Keith-Magee
On Fri, Mar 6, 2009 at 5:51 AM, Jay Deiman wrote: > > I'm currently trying to create a custom Field subclass for the Postgres > specific "inet" and "cidr" types.  I have been able to create the > classes and use them without issue so far.  The problem I am running > into is that I would like to a

Re: Why django checks whether settings.DATABASE_NAME db actually exists for running testcases?

2009-03-05 Thread Russell Keith-Magee
On Fri, Mar 6, 2009 at 5:54 AM, madhav wrote: > > I will be frequently running testcases for my django project. But one > fine day it occured to me that django actually checks the > settings.DATABASE_NAME db actual existence while running testcases. > Why is this so. All I thought was django will

Re: manage.py dumpdata app.model doesn't seem to work?

2009-03-06 Thread Russell Keith-Magee
On Sat, Mar 7, 2009 at 5:48 AM, Alex Koshelev wrote: > This `dumpdata` command you can only serialize whole application not just > its models. This isn't completely correct. As of [9921], you can specify individual models to dumpdata. However, [9921] was committed after the v1.1 alpha 1 release,

Re: IntegrityError: columns app_label, model are not unique

2009-03-08 Thread Russell Keith-Magee
On Sun, Mar 8, 2009 at 2:24 PM, He Jibo wrote: > Dear All, > > I ran into the following error of "IntegrityError: columns app_label, model > are not unique" when I tried to > Sync the data to the db with the command of "manage.py syncdb". I am using > python2.5, Django-1.0.2-final, and Window XP.

Re: loaddata spewing to standard output but not actually loading

2009-03-08 Thread Russell Keith-Magee
On Sat, Mar 7, 2009 at 6:30 AM, Serdar T. wrote: > > Hey everyone, > > While trying to load a json fixture, the contents are spitting out to > my bash shell but nothing is loading into the postgres database > backend. > > From inside my project directory, I'm executing the documented > command: >

Re: loaddata spewing to standard output but not actually loading

2009-03-08 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 12:35 AM, Serdar T. wrote: > > So I'm curious - Does loaddata check all directories on the PYTHONPATH > for the named fixture? Or does it only check for fixtures inside the > project directory where the loaddata command was executed? http://docs.djangoproject.com/en/dev/re

Re: [slightly OT] Web deployment certification

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 1:51 PM, Kenneth Gonsalves wrote: > > Hi, > > I work with a Government department with a mandate to spread FOSS/OSS in both > formal and non-formal education sector. We are planning to introduce a web > deployment certification. A person may be a specialist in say RDBMS or

Re: [slightly OT] Web deployment certification

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 8:23 PM, Russell Keith-Magee wrote: > On Mon, Mar 9, 2009 at 1:51 PM, Kenneth Gonsalves > wrote: >> >> Hi, >> >> I work with a Government department with a mandate to spread FOSS/OSS in both >> formal and non-formal education sector

Re: IntegrityError: columns app_label, model are not unique

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 4:00 AM, He Jibo wrote: > Thank you so much for your detailed explanation. I have tried your > suggestion of "The relatively simple solution that _might_ work (depending > on the details of your project) is to remove references to contrib.auth and > contrib.contenttypes in

Re: I can't decide on a migration framework

2009-03-09 Thread Russell Keith-Magee
On Tue, Mar 10, 2009 at 8:23 AM, Ben Davis wrote: > are you saying that django-evolution does not support migrating between > "versions"  (ie up and down)? Django Evolution doesn't currently support down-migrations. This isn't due to any particular technical limitation - it just hasn't been impl

Re: Django critter helps us code at the speed of light.

2009-03-11 Thread Russell Keith-Magee
On Thu, Mar 12, 2009 at 3:10 AM, Eric Walstad wrote: > > Now you can have your pony AND a Django Critter: > http://starship.python.net/~ewalstad/django_critter.html > > I hope you all enjoy Django as much as we have. Thanks Eric. That really brightened up my morning. Yours, Russ Magee %-) --~-

Re: Problem Installing Fixture: Unbound Prefix

2009-03-12 Thread Russell Keith-Magee
On Thu, Mar 12, 2009 at 8:54 AM, Chris wrote: > > I'm using Django 1.0.2, and I dumped out a sample database as XML > using dumpdata. When I run my unittests using this XML as a fixture, I > get the error: ... > SAXParseException: :20:41: unbound prefix > > This error seems to be caused by tags,

Re: PositiveIntegerField returning a string?

2009-03-13 Thread Russell Keith-Magee
On Sat, Mar 14, 2009 at 3:11 AM, msoulier wrote: > > Hi, > > Django 0.96 (yes, I know, we'll be at 1.0.2. soon), and I have a model > full of PositiveIntegerField attributes. > > One of them is returning a string. > metrics.user_licenses_ca > '315' type(metrics.user_licenses_ca) > It'

Re: Test Client Missing Response Meta Data

2009-03-13 Thread Russell Keith-Magee
On Sat, Mar 14, 2009 at 5:21 AM, Chris wrote: > > I'm trying to test an email sending feature, and the email text > requires the current domain, which I'm getting from request.META > ['HTTP_HOST']. On a normal system, this works fine, but when I access > it using the test framework and django.tes

Re: memcached: is this thing plugged in?

2009-03-17 Thread Russell Keith-Magee
On Wed, Mar 18, 2009 at 6:19 AM, hotani wrote: > > The result? No difference. Memcached does not provide any benefit > according to my testing. I have siege set to log in as a user, then > hit a single page which makes several db calls. The memcached server > shows no movement in CPU, memory, or

Re: OWNING code

2009-03-23 Thread Russell Keith-Magee
On Mon, Mar 23, 2009 at 2:52 PM, mn wrote: > > Hello, > new on here and not a tech guy, wanted to know if a company or > programmer who uses Django can claim they own the code? Firstly, IANAL, etc. There are at least three blocks of code under discussion here. Firstly, there is the code that c

Re: ModelForm - field sort order

2009-03-23 Thread Russell Keith-Magee
On Mon, Mar 23, 2009 at 6:55 PM, PNM wrote: > > I have a sorting problem with a completely basic ModelForm instance > (the class has only Meta with model and fields) -- the object's > __iter__ seems to be following object.fields (as defined in the > model), rather than Meta.fields (as the documen

Re: Hooking up Django signal to urls.py

2009-03-23 Thread Russell Keith-Magee
On Mon, Mar 23, 2009 at 7:17 PM, Addy Yeow wrote: > Hi guys, > > I like to track my visitors URL request in my application. ... > Any idea? Or I should not use signal for this purpose? You could probably get something like this to work, but I have to ask - Is there any reason that you're not jus

Re: Split Database Model for Replication: RW/RO

2009-03-23 Thread Russell Keith-Magee
On Tue, Mar 24, 2009 at 4:05 AM, seblb wrote: > > Hi - is it possible to configure Django so that the admin section > pulls details for a read/write db account/server and the main sites > access the db via read only details? > > This would enable a single point of edit (master database) and multi

Re: Problem with Sum() function

2009-03-23 Thread Russell Keith-Magee
On Tue, Mar 24, 2009 at 12:17 AM, eli wrote: > > How to pass to the Sum() function (ORM) more than one field? > > My problem: > > class Model1(models.Model): >    name = models.CharField(u'Name', max_length=255) > > class Model2(models.Model): >    fk1 = models.ForeignKey(Model1, related_name='fk

Re: inconsistency between remove() and clear()?

2009-03-24 Thread Russell Keith-Magee
On Tue, Mar 24, 2009 at 6:10 PM, Thomas Guettler wrote: > > Hi, > > book2.publisher is an attribute which was created before you deleted it. > If you get book2 again from Book.objects, this attribute would not exist > anymore. > > I have not looked at the underlaying django source, but I guess th

Re: how to run just ONE test?

2009-06-22 Thread Russell Keith-Magee
On Mon, Jun 22, 2009 at 6:42 PM, patrickk wrote: > > this is the first time I´m using the test-framework, so it might be a > really stupid question. > > when using > python manage.py test myapp > or > python manage.py test myapp.BaseTest > I´m getting lots of output for other apps than "myapp" - i

Re: How to load fixtures only once in django unit tests?

2009-06-23 Thread Russell Keith-Magee
On Tue, Jun 23, 2009 at 1:21 PM, Rama Vadakattu wrote: > > In unit tests i need to load few fixtures  i have done as below > >   class TestQuestionBankViews(TestCase): > >        #load this fixtures >        fixtures = ['qbank',] > >        def setUp(self): >            login = self.client.login >

Re: Diffents admin sites into the same project

2009-06-23 Thread Russell Keith-Magee
On Tue, Jun 23, 2009 at 5:55 AM, KrcK wrote: > > Hi group! > > I've a problem with AdminSite. I don't know how can I get 3 admin sites > differents and if it's posible to do it. It is certainly possible, and it's documented: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-objec

Re: How to use Sum function with expression

2009-06-23 Thread Russell Keith-Magee
On Tue, Jun 23, 2009 at 2:36 AM, pr wrote: > > Hi, > > I want to get total price (quantity*price) in this example for objest > list (not one) of A class > > class A(models.Model) >  name = models.CharField(max_length=255) > > class B(models.Model) >  quantity = models.PositiveIntegerField() >  pri

Re: how to run just ONE test?

2009-06-24 Thread Russell Keith-Magee
On Mon, Jun 22, 2009 at 8:50 PM, patrickk wrote: > > unfortunately, I´m still stuck with it ... > > here´s my tests.py: > > import unittest, os > > class BaseTest(unittest.TestCase): >    def setUp(self): >        pass > >    def tearDown(self): >        pass > >    def test_fileobject(self): >  

Re: how to run just ONE test?

2009-06-24 Thread Russell Keith-Magee
On Wed, Jun 24, 2009 at 5:17 PM, patrickk wrote: > > just to avoid any misunderstanding: > when I´m running one test with "... test > myapp.BaseTest.test_fileobject" for example, the output is "... runs 1 > test" - but before that statement there´s a lot of "create table ...", > "installing index

Re: Using Models for non database obejcts?

2009-06-24 Thread Russell Keith-Magee
On Wed, Jun 24, 2009 at 7:03 PM, Kusako wrote: > > Hi- > > Is it possible to use models for objects that are not supposed to be > persisted to the database, or read from it? I would like to use > ModelForms, etc for them, but they should not have a table in the db > or written to or read from the

Re: problem parallel query horizontal sharding postgres pgpool-II django

2009-06-27 Thread Russell Keith-Magee
On Sun, Jun 28, 2009 at 12:40 AM, wrote: > > > Hey > thanks for pgpool2 ... > Please point me to solutions The first step would be to ask on the appropriate mailing list. This is the Django users mailing list. Your problem, and all the traces and messages you have provided, are related to pgpool

Re: Django and dojo

2009-07-06 Thread Russell Keith-Magee
On Mon, Jul 6, 2009 at 8:38 PM, Joshua Partogi wrote: > Dear all, > > Not trying to flame here, but I've just read Jacob's post here: > http://article.gmane.org/gmane.comp.web.dojo.user/3603 > > What made django developers changed their mind not to bundle dojo in 1.0 ? > Is there any history to th

Re: Improve the django-contrib webdesign helpers ... for developers?

2009-07-09 Thread Russell Keith-Magee
On Thu, Jul 9, 2009 at 10:31 PM, Thierry wrote: > > Hi, > > The "webdesign" django.contrib add-on [1] currently implements only 1 > templatetag, supposed to help web designers. I think Django could > benefit from built-in elements that could be useful to web developpers > too, out of the box. > >

Re: Unit testing views.

2009-07-09 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: > > I'm trying to get my django site under tests.  I've started testing my > pages using Client('url/to/my/page'), but I noticed that each test takes > about a second to run (just to get a response code for the page--very > basic tests). Are y

Re: ImportError: No module named urls

2009-07-10 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 10:33 PM, huw_at1 wrote: > > So I switched from mod_python to mod_wsgi since I don;t really know > what is going on and I realise mod_wsgi is recommended for 1.1 now. > Anyway the rest of my site works fine now. The only part still not > working is the admin section which f

Re: Unit testing views.

2009-07-11 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 1:02 PM, J. Clifford Dyer wrote: > > On Fri, 2009-07-10 at 07:58 +0800, Russell Keith-Magee wrote: >> On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: >> > > I am using the django testcase, but without fixtures, because loading > fixtures i

Re: Fresh project, tests fail?

2009-07-12 Thread Russell Keith-Magee
On Mon, Jul 13, 2009 at 12:55 AM, Karen Tracey wrote: > On Sun, Jul 12, 2009 at 8:03 AM, James Bennett > wrote: >> >> [snip a bunch] >> Similarly, contrib.admin -- because it needs to work out-of-the-box >> without requiring you to create any templates -- supplies templates >> with the names cont

Re: Constraining LEFT OUTER JOIN with aggregates?

2009-07-13 Thread Russell Keith-Magee
On Sun, Jul 12, 2009 at 11:01 PM, Mat wrote: > > I'm trying to replace a convoluted database-specific SQL statement > with the new aggregates functionality. As an example, say I have a > database structured with tables for blogs running on many domains > (think .co.uk, .com, .etc), each taking man

Re: Queries for Related Objects wonky

2009-07-13 Thread Russell Keith-Magee
On Tue, Jul 14, 2009 at 10:31 AM, Streamweaver wrote: >> For example I have a model called Project with a ForeignKey to a >> Django User. >> >> class Project(models.Model): >>... >> owner = models.ForeignKey(User) >> ... >> >> by the documentation I would expect the following to give me

Re: Question regarding post_save signal and ManyToMany field objects

2009-07-14 Thread Russell Keith-Magee
On Tue, Jul 14, 2009 at 6:27 PM, Ryan K wrote: > > Yea...it would be so elegant too! Here is a "bug" filing: > http://code.djangoproject.com/ticket/5390. It's been open for two > years A little history may help explain why this has been open for so long. Historically (i.e., when dinosaurs ro

Re: 1.1 request

2009-07-15 Thread Russell Keith-Magee
On Wed, Jul 15, 2009 at 10:54 PM, Up2L8 wrote: > > Is there any way Ticket #10977 could get rolled up into the 1.1 > release? > > Using the intersection and union operators seems borked for some > applications and it sounds like this should fix it. I'll take a look tomorrow if I get time, but no

Re: Done? Database -> Python objects -> JSON -> JavaScript 'class instances'

2009-07-15 Thread Russell Keith-Magee
On Thu, Jul 16, 2009 at 3:12 AM, jfine wrote: > > Hi > > Django can, of course, serialize database objects into JSON: >    http://docs.djangoproject.com/en/dev/topics/serialization/ > > I'd like to turn that JSON into JavaScript objects.  I'd like, of > course, a Formula object to be turned into a

Re: Saving Data To Your DB. Simple?

2009-07-15 Thread Russell Keith-Magee
On Thu, Jul 16, 2009 at 8:36 AM, The Danny Bos wrote: > > Any ideas on this one guys? > > I gave up on it last night. > I feel way off ... Ok - some back tracking. Your first approach (no forms) should have worked. The reason you didn't get any errors is that your code is explicitly ignoring _al

Re: Saving Data To Your DB. Simple?

2009-07-16 Thread Russell Keith-Magee
On Thu, Jul 16, 2009 at 9:27 PM, The Danny Bos wrote: > > So, I'm guessing this is impossible. I'm guessing you need to have a little patience. This is a volunteer list. Sometimes, when you don't get an answer, it's because the people who are in a position to answer your question are busy. It's a

Re: How do you unit test forms

2009-07-16 Thread Russell Keith-Magee
On Thu, Jul 16, 2009 at 10:46 PM, Joshua Russo wrote: > > I want to test my forms but I'm not sure the best way to go about it. > It seems like it might be similar to views but I can't find much > discussion of form testing in any of the discussions about unit > testing. > > Any suggestions are mu

Re: How do you unit test forms

2009-07-16 Thread Russell Keith-Magee
On Fri, Jul 17, 2009 at 9:56 AM, Joshua Partogi wrote: > Hi Russ, > > To expand this question. Do we use unittest for testing forms? Because from > what I see in the code, doctest only tests your model. CMIIW. I shall. I don't know where you got that idea. :-) doctests are just a way of expressi

Re: Related set need some impovement

2009-07-16 Thread Russell Keith-Magee
On Thu, Jul 16, 2009 at 9:00 PM, Ilya Novoselov wrote: > > I'm sorry if this have been discussed before. > > I have table A, which have foreign key foo to model B. > > When I query B related set trough B.a_set.all(). > When I iterate over b_instance.a_set.all() and access foo member, > Django does

Re: RequestContext current_app keyword argument

2009-07-17 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 7:27 AM, Vasil Vangelovski wrote: > > Looking at the code for the ModelAdmin class in > django.contrib.admin.options I've come accross this: > context_instance = template.RequestContext(request, > current_app=self.admin_site.name) > in a few places. What is this current_app

Re: Flushing the cache during testing

2009-07-17 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 6:21 AM, Andrew Fong wrote: > > I'm playing around with some low-level caching of model instances. > During testing, it's necessary for me to flush out the cache so cached > whatnot from one test doesn't pollute another. > > To my knowledge, Django's currently doesn't offer

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-17 Thread Russell Keith-Magee
On Fri, Jul 17, 2009 at 11:06 PM, Miriam wrote: > > There currently is no way in Django to pre-fetch one-to-many and/or > many-to-many relationships, right? Correct. > There's select_related, which will pre-fetch FK or one-to-one, which > is great, but not sufficient. > > Suppose I am fetching a

Re: Accessing Meta properties and a templating question.

2009-07-17 Thread Russell Keith-Magee
On Fri, Jul 17, 2009 at 9:53 PM, Beetle B. wrote: > > Hi, > > 1. In the Python code, how can I access various Meta properties of a > model (e.g. verbose_name, etc). At the moment, I do it via > model._meta.verbose_name, but I always get chills down my spine when I > access properties beginning wit

Re: Accessing Meta properties and a templating question.

2009-07-18 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 11:08 AM, Beetle B. wrote: > > Russell Keith-Magee wrote: >> > 1. In the Python code, how can I access various Meta properties of a >> > model (e.g. verbose_name, etc). At the moment, I do it via >> > model._meta.verbose_name, but I alway

Re: How do you unit test forms

2009-07-18 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 7:47 PM, Joshua Russo wrote: > On Sat, Jul 18, 2009 at 9:38 AM, V wrote: >> >> Some time ago I wrote down my experience on testing, including testing >> forms: http://viktornagy.com/blog/2009/05/24/what-test-django/ >> >> moreover, I would recommend to check out the tests

Re: How does my Model gets the objects attribute

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 4:05 PM, Joshua Partogi wrote: > Dear all, > > This may seems trivial. I've been looking at django source code > model/base.py and been looking around how django gives my model an objects > attribute but can not find it. I can see that the ModelBase will give the > _default

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 11:21 PM, Miriam wrote: > > Hi Russ -- > > Thanks for your response. I figured there must have been discussion on > this at some point, given that this is a pretty common use case, and > one that other ORMs already tackle with varying degrees of success. Is > there a ticket

Re: Filter aggregation results

2009-07-20 Thread Russell Keith-Magee
On Tue, Jul 21, 2009 at 3:11 AM, Michel Thadeu Sabchuk wrote: > > Hi guys, > > Is there a way to filter an aggregation? Suppose the following code: > > Book.objects.annotate(num_authors=Count('authors')).order_by > ('num_authors') > > How can I count only masculine authors or authors by age? I thi

Re: Multitable inheritance and select_related() not working

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 4:30 PM, Jim wrote: > > My Django version is 1.0.2-final (http://media.djangoproject.com/ > releases/1.0.2/Django-1.0.2-final.tar.gz) > > I have an issue with select_related() not working. I can reproduce it > with the following steps: > I have followed the django tutorial

Re: Customizing context by opening up BoundField, is it ok?

2009-07-22 Thread Russell Keith-Magee
On Wed, Jul 22, 2009 at 3:46 AM, Joshua Russo wrote: > > I have a complex form that where I generate a grid (for lack of a > better term) of fields for data entry. To simplify the template > context I have a dictionaries within dictionaries so I can just use > FOR loops within FOR loops in the tem

Re: Bug when creating Q object from string representation of another Q object?

2009-07-22 Thread Russell Keith-Magee
On Wed, Jul 22, 2009 at 5:52 AM, Margie wrote: > > I have a situation where I want to do the following: >       take a bunch of POST params and from them create a Q object >       urlencode that Q object and turn it into a GET param, redirect > using that param >       process the GET that contain

Re: Cascade Soft Delete

2009-07-22 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 2:57 AM, Steven Stelmach wrote: > > Hi all, > > I'm working with models (for a newspaper site) similar to this: > > - Abstract class Content with child class Article. > - Each Content object is related one-to-one with a ContentGeneric, > which has a published_status field.

Re: Cascade Soft Delete

2009-07-22 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 2:57 AM, Steven Stelmach wrote: > > Hi all, > > I'm working with models (for a newspaper site) similar to this: > > - Abstract class Content with child class Article. > - Each Content object is related one-to-one with a ContentGeneric, > which has a published_status field.

Re: Customizing context by opening up BoundField, is it ok?

2009-07-22 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 3:51 AM, Joshua Russo wrote: > On Wed, Jul 22, 2009 at 10:51 AM, Russell Keith-Magee > wrote: >> >> Secondly, it's difficult to give an appraisal of a technique when all >> you have to go by is a vague description. Your explanation is a bit &g

Re: Django-admin {{ root_path }} problem !

2009-07-22 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 12:57 PM, Hamza wrote: > > Hello , > > i have an issue in Django-Admin , when i click on logout and change > password , it add /admin/logout and /admin/change_password/ to the > current path as in http://localhost:8000/admin/posts/admin/logout/ and > does the same to passwo

Re: Django-admin {{ root_path }} problem !

2009-07-22 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 1:42 PM, Dr.Hamza Mousa wrote: > do you mean admin templates ?! i think its the template file of the RC ! Saying "I think" isn't quite the help we're looking for - are you using the default admin templates, or not? Have you taken _any_ copies of the admin templates? When y

Re: Django-admin {{ root_path }} problem !

2009-07-23 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 2:30 PM, Dr.Hamza Mousa wrote: > Hi Russell > > The admin templates i copied into /templates/admin/ . > > The idea : i need to customize the admin for a project am working on . > > -details : > > installed django RC 1.1 , ubuntu linux 9.04 . > > so i ran : > > django-admin.

Re: PostgreSQL Stored Procedure in ordinary Django query expression?

2009-07-23 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 11:55 PM, Adam Seering wrote: > > Hey folks, >        I have a PostgreSQL stored procedure that does some fairly complex > logic to query/filter a particular table (though it ultimately does > return rows straight from that table).  I'm trying to call this stored > procedur

Re: forms with django and extjs 3.0.0

2009-07-23 Thread Russell Keith-Magee
On Thu, Jul 23, 2009 at 5:43 PM, Emily Rodgers wrote: > > Hi all, > > I am currently working on some web apps that use django for the back > end, and extjs for the front end (using JSON to pass data between the > two). > > I am getting to the point where I am going to have to start doing some > fo

Re: which version of django should I choose?

2009-07-24 Thread Russell Keith-Magee
On Fri, Jul 24, 2009 at 6:32 PM, Kenneth Gonsalves wrote: > > On Friday 24 Jul 2009 2:59:29 pm XUN ZHOU wrote: >> hello, I am new beginner in django. I want to learn python with django and >> later I want to write my first application in google App engine. >> there are so many different version of

Re: Signals API

2009-07-24 Thread Russell Keith-Magee
On Sat, Jul 25, 2009 at 8:42 AM, Glenn Maynard wrote: > > Is the Signals API public?  There's > http://docs.djangoproject.com/en/dev/topics/signals/, which explains > connecting to signals (so Signal.connect is public), but the rest of > Signal, eg. Signal.disconnect, doesn't seem to be in there a

Re: Non ASCII URL characters in Django

2009-07-26 Thread Russell Keith-Magee
On Sun, Jul 26, 2009 at 9:42 PM, Shivaraj wrote: > > Django doesn't allow urlecode or urlopen when there is a non-ASCII/ > international characters in the url. Django does no such thing. Firstly, urlencode and urlopen aren't part of Django's API, so this isn't an issue of Django's making. Full u

Re: Auth test with custom auth backend

2009-07-26 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 6:17 AM, Vitaly Babiy wrote: > Hey, > I have replaced the default auth backend with my own that requires a field > to be set on my own custom user objects. So when I run my test suite ( which > includes the auth app ) most of the auth test fail. Due to the fact that > djang

Re: Chained Views - as in Catalyst (perl)

2009-07-26 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 7:55 AM, Alexandru Nedelcu wrote: > > Hi, > > I'm a newbie when it comes to Django ... I picked it up for a personal > project because it seemed like a good fit. > > I do miss a feature from Catalyst ... chained actions. > I added this functionality to Django by myself (jus

Re: Non ASCII URL characters in Django

2009-07-27 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 3:26 PM, Shivaraj wrote: > > Let me repeat the original question. > If I put a nonASCII character to urlopen / urlencode and try to open > an url in python prompt it works fine. > So it's not issue with python(2.6+) as of now. > > Now I call the same functions from Django a

Re: Full-text search: what to use

2009-07-27 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 11:14 PM, alex finn wrote: > > Hello, > > I'm working on a huge django-based application that heavily utilizes > full-text search. Up until now I've been using external search service > built using SOLR that is deployed separately. > The problem is with such an approach I n

Re: Full-text search: what to use

2009-07-28 Thread Russell Keith-Magee
On Tue, Jul 28, 2009 at 1:58 PM, Torsten Bronger wrote: > > Hallöchen! > > Russell Keith-Magee writes: > >> [...] >> >> As one data point - I use Sphinx fairly extensively at work. During >> development, I looked at Lucene as well, in the form of Solr (w

Re: Chained Views - as in Catalyst (perl)

2009-07-28 Thread Russell Keith-Magee
On Tue, Jul 28, 2009 at 9:05 PM, Masklinn wrote: > >> I'm also a bit disappointed by your tone. Again, chill, drink some >> coffee, relax a little ;) > Pot, kettle, etc… Ok - both of you settle down. A casual observer can tell that this "debate" is going nowhere in particular. In the interests o

Re: Load order for fixtures

2009-07-29 Thread Russell Keith-Magee
On Thu, Jul 30, 2009 at 12:48 AM, Aaron wrote: > > Hi all, > > Is there a way to force the order of apps from which fixtures are > loaded? We have fixtures in one app that depend ( via foreign keys ) > on fixtures in another app being already loaded. In short no. The problem you describe only exi

Re: Can i add initial admin user?

2009-08-01 Thread Russell Keith-Magee
On Sat, Aug 1, 2009 at 5:38 PM, Mirat Can Bayrak wrote: > > i am playing a lot with my models in my project nowadays. On every change i > am deleting my sqlite3 file and running syncdb again.. its ok but creating a > admin user in every syncdb is booored me. is there any way to give django a >

Re: subclassed ModelForms initial values behavior changed from 1.1beta to 1.1

2009-08-02 Thread Russell Keith-Magee
On Sun, Aug 2, 2009 at 12:58 PM, David Haas wrote: > > Ramiro: > > I've set up some models / forms / formsets which demonstrate the > change here: > > http://dpaste.de/YhrI/ > > My initial report wasn't correct - the change in behavior is only seen > when initalizing ModelFormSets . . . the ModelF

Re: Applications as components

2009-08-02 Thread Russell Keith-Magee
On Sun, Aug 2, 2009 at 10:26 PM, Torsten Bronger wrote: > > Hallöchen! > > My first Django project was a single application.  Probably most of > you started this way, with only some other applications shipped with > Django installed on the same site, too. > > However, I now prepare my second Djang

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Russell Keith-Magee
On Sun, Aug 2, 2009 at 11:56 PM, David Koblas wrote: > > Just to add my $0.02 cents to this, I too would like a better way to > extend django.contrib.auth.models.User than the current approach.  The > two biggest "problems" that I have are: > > * Everything depends on django.contrib.auth.models.Us

Re: locking up development server

2009-08-02 Thread Russell Keith-Magee
On Mon, Aug 3, 2009 at 12:01 PM, Rusty Greer wrote: > > i added a column to one of my tables in my db.  i added the column in > the model definition, then i went into mysql and added the column with > what i think is the appropriate alter table command. > the command i used was: >  alter table db_

Re: annotate() and subsets or related records

2009-08-03 Thread Russell Keith-Magee
On Tue, Aug 4, 2009 at 5:17 AM, Javier Guerra wrote: > > Hi all, > > > I've just upgraded to 1.1 (congrats everybody!), and want to put the > aggregation/annotation features to use.  but it doesn't seem to be a > way to annotate the records with counts of different subsets of > related records. >

Re: {% url %} templatetag and url namespaces

2009-08-03 Thread Russell Keith-Magee
2009/8/4 Daybreaker : > > I've fixed the wrong url templatetag to this: > > {% url lab:bbs:view > url_key=lab_object.url_key,board_id=board.id,article_id=item.id %} The problem here is that namespaces can't contain parameters. For example: urlpatterns = patterns('myproject.lab.views', url(ur

Re: subclassed ModelForms initial values behavior changed from 1.1beta to 1.1

2009-08-04 Thread Russell Keith-Magee
On Mon, Aug 3, 2009 at 3:46 AM, David Haas wrote: > > It looks like the change happened between rev. 10189 & 10190: 10189 > displays the value, 10190 doesn't. > > Unfortunately, I don't think I can give you a completely unbiased > answer as to what behavior I think > is more correct, because of hi

Re: Intermediate Table question

2009-08-04 Thread Russell Keith-Magee
On Wed, Aug 5, 2009 at 12:58 AM, LeeRisq wrote: > > Does anyone know if an intermediate table can be specified on more > than two models? For instance: > > class A(m.Model): >       B = ManyToManyField(B, through='D') >       C = ManyToManyField(C, through='D') > > Will this validate and actually

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