Re: Building a library of SQL functions into Django

2014-06-18 Thread Chris Wilson
Hi Carl, On Wed, 18 Jun 2014, Carl Meyer wrote: I think database backends should have a hook to override the SQL implementation of any given Function. I don't think this needs to imply pushing the default implementation of all Functions down into the database backend (that just makes life unn

Re: Building a library of SQL functions into Django

2014-06-18 Thread Chris Wilson
Hi Carl, On Wed, 18 Jun 2014, Carl Meyer wrote: On 06/18/2014 02:59 PM, Aymeric Augustin wrote: 2014-06-18 19:18 GMT+02:00 Carl Meyer mailto:c...@oddbird.net>>: If you need a Function in your project (whether provided by Django or by a third-party library), and the Function doesn't natively s

Re: [GSOC] Shifting to Py.Test and Improving the Test Suite

2014-04-07 Thread Chris Wilson
Hi Andrew, On Sun, 6 Apr 2014, Chris Wilson wrote: On Sun, 6 Apr 2014, Andrew Pashkin wrote: * It makes it much harder to write custom assertions and get meaningful display on error. Can you give an examples for cases with messages/breakings and for custom assertions? I don't ha

Re: [GSOC] Shifting to Py.Test and Improving the Test Suite

2014-04-06 Thread Chris Wilson
Hi Andrew, On Sun, 6 Apr 2014, Andrew Pashkin wrote: * It makes it much harder to write custom assertions and get meaningful display on error. Can you give an examples for cases with messages/breakings and for custom assertions? I don't have an example of breakage to hand, I ripped out the

Re: [GSOC] Shifting to Py.Test and Improving the Test Suite

2014-04-06 Thread Chris Wilson
Hi Andrew, I'm not a Django core contributor but just a user and occasional patcher. I submit some comments on this proposal in the hope that they will be useful. On Sun, 6 Apr 2014, Andrew Pashkin wrote: Some Pytest advocacy: 1) Pytest has convenient tests collection options - you can just

Re: Saving forms without validation, and formsets

2014-03-19 Thread Chris Wilson
Hi all, As part of our test process we have code that automatically fills in forms with dummy values to make them valid. It fills in all required fields. This works well except for formsets. BaseModelFormSet.add_fields() adds a PK field to the form after it's created. It marks this field as n

Re: Saving forms without validation, and formsets

2014-03-19 Thread Chris Wilson
Hi Carl, On Tue, 18 Mar 2014, Carl Meyer wrote: On 03/18/2014 02:54 PM, Chris Wilson wrote: 1. GCBV and Vanilla Views do a great job for simple forms, but they leave out embedded formsets entirely. (For example our large form has repeating sections for employment history, education, etc.) It

Saving forms without validation, and formsets

2014-03-18 Thread Chris Wilson
Hi all, (Apologies if this belongs on django-users instead. To clarify, I'm interested in what appear to be potentially missing or useful features in Django, and whether it's worth implementing them and submitting pull requests, or creating separate reusable modules to implement them. I'm als

Re: should we include images in Django documentation?

2014-02-22 Thread Chris Wilson
Hi all, On Sat, 22 Feb 2014, Aymeric Augustin wrote: There's already a few images and I can't see any reason against adding more where appropriate. There's just one small hurdle. Last time I checked, the intersection of "editors producing good-looking diagrams" and "open-source diagram edit

Re: [GSOC] Improving the Test-Suite

2014-02-15 Thread Chris Wilson
Hi all, On Sat, 15 Feb 2014, Russell Keith-Magee wrote: One of the improvements I see is classification of test cases. Classifying them into categories (read multiple-categories), would make it easier for users/developers/maintainers to run them. Basis of classification,etc is what I am still

Re: #19182 backport request

2014-02-14 Thread Chris Wilson
Hi Tim, On Fri, 14 Feb 2014, Tim Graham wrote: I sympathize with your frustration. On the other hand as we have over 500 bugs in Trac, and I'm not sure starting to accept documentation requests for them is the best use of our resources. I'm not sure the feature is really completely broken eno

Re: #19182 backport request

2014-02-14 Thread Chris Wilson
Hi all, On Fri, 14 Feb 2014, Florian Apolloner wrote: as Tim noted on the ticket, we are not going to backport this as per our policy. In that case will you accept patches to remove description of the broken feature from the documentation for 1.4, 1.5 and 1.6? Cheers, Chris. -- Aptivate | ht

#19182 backport request

2014-02-14 Thread Chris Wilson
Hi all, I just ran into bug #19182 : ModelAdmin filtering didn't work when list_filter includes a ('fieldname', ClassName) tuple, but throws a SuspiciousOperation exception instead. The ChangeList would display fine, but as soon as you tried to use

Re: Django doesn't log much at high verbosity levels

2014-02-04 Thread Chris Wilson
Hi Russell, On Tue, 4 Feb 2014, Russell Keith-Magee wrote: A definite "Maybe". :-) For my money, this is probably something that is handled better by the web server. Apache, for example, logs one line per request, and can be configured to dump full GET and POST contents if you need that info

Django doesn't log much at high verbosity levels

2014-02-03 Thread Chris Wilson
Hi all, I'd expect that Django would log something like: * At INFO level, at least one line per request (similar to runserver output) * At DEBUG level, enough information to recreate the request However, it doesn't appear to: * There are only two logger.debug statements, both logging databas

Re: Django ORM support for NoSql databases

2013-12-17 Thread Chris Wilson
Hi all, On Tue, 17 Dec 2013, Tom Evans wrote: On Tue, Dec 17, 2013 at 3:35 PM, parisrocks wrote: Waiting for official Django ORM support for NoSql databases. MongoDB (and the vast majority of NoSQL databases) are not relational databases, they are document oriented databases, they store do

Re: Deprecation a little harsh?

2013-08-12 Thread Chris Wilson
Hi all, On Mon, 12 Aug 2013, Jacob Kaplan-Moss wrote: If you'd like to help push us closer to where *you* think the right place balance is, the best thing to do is to watch our development process and speak up in the moment. These sorts of general, post-facto observations don't give us a ton

Re: Custom Chainable QuerySets (#20625)

2013-07-22 Thread Chris Wilson
Hi Aymeric, On Mon, 22 Jul 2013, Aymeric Augustin wrote: The idea of `QuerySet .as_manager()` sounded sane to me at first—especially in the light of the failure of various other attempts—but it creates a circular dependency between `Manager` and `QuerySet`. Creating the `Manager` class now re

Re: Composite fields -- (ir)regular status report #3

2013-07-22 Thread Chris Wilson
On Mon, 22 Jul 2013, Michal Petrucha wrote: I have some awesome news today. At long last I managed to finally get the refactor of ForeignKey to pass the entire test suite. That is awesome news! Well done Michal! I am really looking forward to having this feature available in Django. Cheers,

Ticket #7220: Last_login in django.contrib.auth should have null=True

2013-06-01 Thread Chris Wilson
Hi all, Regarding ticket #7220 , this is bugging me at the moment. I share a database with a non-django app, and need to insert test data, and having to set last_login to something is annoying. I understand @SmileyChris' point that there are no mig

Re: test discovery

2013-05-18 Thread Chris Wilson
Hi Carl, On Sat, 18 May 2013, Carl Meyer wrote: I don't think this should be fixed in the test runner itself; in general, file-path test labels _should_ be interpreted as relative to wherever you are running the tests from. But it should be fixed in the test_runner.test_discover_runner.Disc

Re: test discovery

2013-05-18 Thread Chris Wilson
Hi all, Another odd behaviour of the new test runner. This runs the tests, but fails to add the test app to INSTALLED_APPS, so they all fail because their tables are not created: PYTHONPATH=.. python -Wall runtests.py --selenium --verbosity 2 \ --settings=tests.travis_configs.test_pos

Re: test discovery

2013-05-18 Thread Chris Wilson
On Sat, 18 May 2013, Chris Wilson wrote: I think Travis is unhappy about something in this commit. Any ideas? == ERROR: test_file_path (test_runner.test_discover_runner.DiscoverRunnerTest

Re: test discovery

2013-05-18 Thread Chris Wilson
Hi all, On Fri, 10 May 2013, Carl Meyer wrote: I merged this patch tonight. Thanks to everyone who contributed! Now let's see how the CI servers feel about it... I think Travis is unhappy about something in this commit. Any ideas? =

Re: Travis support (again)

2013-05-18 Thread Chris Wilson
Hi all, On Thu, 7 Mar 2013, Jacob Kaplan-Moss wrote: On Mon, Feb 25, 2013 at 4:48 PM, Florian Apolloner wrote: So all in all I think we could enable travis, I agree, +1 from me. One issue standing in the way: Travis will try to build any branch without a .travis.yml file as though it was

Re: Perception of attitude in tickets

2013-05-13 Thread Chris Wilson
On Mon, 13 May 2013, Kirby, Chaim [BSD] - PED wrote: WONTFIX has a long history in software development. It also does (correctly) state intentionality that 'onholdindefinite' lacks. The intention of WONTFIX is "yes, this is possibly valid, but in the state this ticket is written it is being cl

Re: Perception of attitude in tickets

2013-05-13 Thread Chris Wilson
Hi Luke, On Mon, 13 May 2013, Luke Sneeringer wrote: On May 13, 2013, at 10:06 AM, AK wrote: WONTFIX does sound rude to me, as well. Perhaps 'onholdindefinite' can be used instead, the effective meaning is the same, just the term itself is more polite. It seems that nobody looking at it woul

Re: Perception of attitude in tickets

2013-05-13 Thread Chris Wilson
Hi all, On Mon, 13 May 2013, Russell Keith-Magee wrote: This isn't political equivocating. Its a genuine call to the community to tell us how we can make things better. If I may make a suggestion to be considered by the community: The status WONTFIX sounds awfully rude to me. It's like sayin

Re: reconsider re-opening ticket 901

2013-05-13 Thread Chris Wilson
Hi all, On Sun, 12 May 2013, Shai Berger wrote: those should probably be updated (on remote objects!) too, or else some serious inconsistencies may be created (when the _id field changes, that is). aa= A.objects.get(...) bb= aa.b (some other operation, changing aa.b_id in the database) aa.re

Re: URL dispatcher fallthrough?

2013-03-18 Thread Chris Wilson
Hi Julian, On Mon, 18 Mar 2013, julianb wrote: imagine the following use case: You build an online store where you have sorted products into several categories and maybe associated an occasion. Now you want to build URLs. So the URL schema that all of the store's owners agree on is: // // /

Re: Switch to database-level autocommit

2013-03-05 Thread Chris Wilson
Hi Lennart, On Tue, 5 Mar 2013, Lennart Regebro wrote: I do agree that 99.9% of the sites committing on the end of the request is the right thing to do, and do think that this should be the default, although I realize that debate is already lost. In a perfect academic world where there are n

Re: save() method could return the object

2012-10-12 Thread Chris Wilson
On Fri, 12 Oct 2012, Marijonas Petrauskas wrote: There already exists create method that does exactly what you need:obj = SomeModel.objects.create(name='foo', age=42) OK, thanks, that appears to be completely undocumented. Cheers, Chris. -- Aptivate | http://www.aptivate.org | Phone: +44 122

Re: A.objects.getdefault

2012-10-12 Thread Chris Wilson
Hi all, On Thu, 11 Oct 2012, Daniel Moisset wrote: obj, = SomeModel.objects.filter(foo='bar') or [None] Daniel's solution is elegant, but far from clear or clean. I'm strongly in favour of a simple, obvious way to do the common thing, which is to return None if the object doesn't exist, ins

save() method could return the object

2012-10-12 Thread Chris Wilson
Hi all, If the save() method returned the object itself, then we could chain it like this: old_status = Status(last_contact=None).save() Instead of having to do this: old_status = Status(last_contact=None) old_status.save() It's a trivial one-line change to the Model

Re: Proposal: use SQLAlchemy Core for query generation

2012-07-03 Thread Chris Wilson
Hi Reinout, On Tue, 3 Jul 2012, Reinout van Rees wrote: On 30-06-12 16:22, Luke Plant wrote: Also, in Django to date we've eschewed external dependencies. That has been partly due to the poor and confusing state of Python packaging, which is hopefully improving. [snip] Our current recommende

Re: I think adding a "first" method to the QuerySet be useful.

2012-07-03 Thread Chris Wilson
Hi all, On Tue, 3 Jul 2012, Łukasz Rekucki wrote: On 3 July 2012 06:27, Maxime Haineault wrote: One of the common pitfall I come across way to often with novices is something like this: def getFirstUser(): return User.objects.all()[0] It looks innocuous and often wont raise any e

Re: Test runner with search

2012-06-18 Thread Chris Wilson
Hi all, On Mon, 18 Jun 2012, Anssi Kääriäinen wrote: > On 16 kesä, 09:29, Russell Keith-Magee > > > > Well, sure -- easier is better -- but is this actually going to be > > easier? Are you saying that you've never written two test classes with > > the same test name? I don't think I have, but I

Re: Test runner with search

2012-06-14 Thread Chris Wilson
Hi Andrew, On Thu, 14 Jun 2012, Andrew Godwin wrote: > +1 from me as well - the test runner you linked to looks reasonably > sane, only a few small things that I'm questioning (like why types is > imported inside the for loop). I prefer to keep the imports as close to the code that uses them a

Test runner with search

2012-06-14 Thread Chris Wilson
Hi all, I've made some improvements (in my view) to the DjangoTestSuiteRunner. I got tired of having to remember my test class names and of typing so much: ./manage.py test binder.BinderTest.test_can_create_users This new version searches for tests with the given name in all INSTALLED_APPS,

Re: Allow changing form field properties after form creation

2012-06-08 Thread Chris Wilson
Hi Simon, On Fri, 6 Apr 2012, Simon Meers wrote: On 6 April 2012 07:26, Beres Botond wrote: Isn't it this what you are trying to do? class DocumentForm(ModelForm):        def __init__(self, *args, **kwargs):                super(MyForm, self).__init__(*args, **kwargs)                self.fie

Re: Allow changing form field properties after form creation

2012-04-05 Thread Chris Wilson
Hi Brian, On Thu, 5 Apr 2012, Brian Neal wrote: On Thursday, April 5, 2012 6:49:20 AM UTC-5, Chris Wilson wrote: class DocumentForm(ModelForm):      title = models.Document._meta.get_field('title').formfield(required=False) You can already replace and tweak the f

Re: Allow changing form field properties after form creation

2012-04-05 Thread Chris Wilson
Hi Nate, On Thu, 5 Apr 2012, Nate Bragg wrote: They don't "have" to be replaced in a subclass in the way you showed. Perhaps it isn't perfectly DRY, but whats so bad about naming the field explicitly? The fact that we're building reusable components and we want people to be able to subclass

Allow changing form field properties after form creation

2012-04-05 Thread Chris Wilson
Hi all, I've added this as a ticket but I wanted to make sure that the core and forms developers have a chance to see and interact with it, so I'm posting it here too. You can find the ticket at: Currently, if I want to tweak the properties of so

Re: Why recommend to include project name in settings?

2012-02-10 Thread Chris Wilson
Hi Carl, On Fri, 10 Feb 2012, Carl Meyer wrote: Is there any reason not to drop the project name part of DJANGO_SETTINGS_MODULE and ROOT_URLCONF, to reduce the risk of confusion, pollution, double imports and bad practice app coding in Django? If you follow that quoted thread to the end, yo

Why recommend to include project name in settings?

2012-02-10 Thread Chris Wilson
Hi all, I'd like to inquire about the design decision to recommend users to include the project name in DJANGO_SETTINGS_MODULE and ROOT_URLCONF, for example: When using django-admin.py, you can either set the environment variable once, or explicitly pass in the settings module each time you

Adding fields to admin forms

2012-02-09 Thread Chris Wilson
Hi all, I want to be able to add extra fields, that I control, to the admin forms. For example, a read-only list of documents authored by the user, which is ManyToMany, so an InlineAdmin doesn't work. The admin module docs don't really say whether this is possible or not. They have much more

Feature request: read-only admin view

2012-01-27 Thread Chris Wilson
Hi all, I really like how the admin interface does a lot of the work for me in developing a site with basic CRUD functions, and a few free bonuses like pagination and list filtering. I agree with all the comments on #820 requesting this feature (as wel

ModelForm._post_clean could simply call Model.full_clean

2012-01-27 Thread Chris Wilson
Hi all, I proposed this in a comment on #16423 , and then found that it had come up before: https://code.djangoproject.com/ticket/13100 https://code.djangoproject.com/ticket/13121 and was rejected thus: I think model-validation is just no