Could prefetch_related be modified to utilize select_related for ForeignKey relations?

2012-02-19 Thread Yo-Yo Ma
Speaking with regards to the ORM method documented at https://docs.djangoproject.com/en/dev/ref/models/querysets/#prefetch-related Of course, ``prefetch_related`` uses a Pythonic join to attach reverse- related objects and avoids the N+1 queries problem, which of course is great. However, if you

auto_now=True fields aren't updated on QuerySet.update()

2012-02-20 Thread Yo-Yo Ma
If you call ``QuerySet.update`` on the following model, you'll get the results that proceed it: # models.py class Person(models.Model): cool = models.BooleanField(default=False) updated_on=DateTimeField(auto_now=True) # django-admin.py shell >>> from myapp.models import Person >>> >>> #

Re: auto_now=True fields aren't updated on QuerySet.update()

2012-02-20 Thread Yo-Yo Ma
On a related note, the new timezone.now() functionality is used for ``DateTimeField.pre_save`` when ``auto_now=True``, but it isn't used for ``DateField.pre_save`` or ``TimeField.pre_save``. Is this a bug I should report, or is there something I'm missing (I'm pretty uninformed when it comes to

Re-posting of previous thread: ``QuerySet.update`` not updating ``auto_now=True`` fields

2012-02-20 Thread Yo-Yo Ma
It seems my previous question was co-opted... by myself, so rather than try to distract the conversation about TZ stuff (which seems to be pretty important stuff, esp with the 1.4 launch), I figured I'd start a new thread with my original question. Here it is: If you call ``QuerySet.update`` on

Re: auto_now=True fields aren't updated on QuerySet.update()

2012-02-20 Thread Yo-Yo Ma
I haven't quite read up on all the UTC-related stuff in Django as of yet (couldn't find much info about it), but I found some of the posts above concerning. It would seem that if a DateTimeField should be updated with ``timezone.now()``, then a DateField should be updated with

Re: auto_now=True fields aren't updated on QuerySet.update()

2012-02-20 Thread Yo-Yo Ma
I actually know so little that I was even more confused by my own question, but I appreciate your reply, Danny. I feel pretty challenged when I try to understand timezone-related stuff. Is this correct: When using UTC, which, if any, are true: A) If I have a view that simply adds a record of a

Re: auto_now=True fields aren't updated on QuerySet.update()

2012-02-20 Thread Yo-Yo Ma
Thanks, Danny. That's really helpful to me, and I appreciate you taking the time to explain it. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from

django-admin.py startproject creating duplicate settings.py files

2012-02-20 Thread Yo-Yo Ma
I have trunk installed from last night, and this is actual terminal output (except for the stuff omitted on the left of the $): (my_venv) myusername$ django-admin.py startproject foobarz (my_venv) myusername$ ls foobarz/ __init__.py foobarz manage.py settings.py urls.py

Re: django-admin.py startproject creating duplicate settings.py files

2012-02-20 Thread Yo-Yo Ma
-1.4b1-py2.7.egg- info On Feb 20, 8:56 pm, Carl Meyer <c...@oddbird.net> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 02/20/2012 08:31 PM, Yo-Yo Ma wrote: > > > I have trunk installed from last night, and this is actual terminal > > output (except

Re: Revisiting multiline tags

2012-02-25 Thread Yo-Yo Ma
After Ned's message, I'm -0, because while I'm not fond of multi-line tags, I cannot offer a good alternative when it comes to multi-line "with" tags. On Feb 25, 6:48 pm, Ned Batchelder <n...@nedbatchelder.com> wrote: > On 2/24/2012 11:55 PM, Yo-Yo Ma wrote:> I'm -1 on this

USE_TZ related warnings caused by fixture loading

2012-03-01 Thread Yo-Yo Ma
django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-01-01 00:00:00) while time zone support is active. The above warning is caused by a JSON fixture having "2012-01-01 00:00:00" for a DateTimeField timestamp. Does this mean that fixture

Re: gsoc proposal, dynamic list form field

2012-03-25 Thread Yo-Yo Ma
On Mar 25, 2:41 am, Roy McElmurry IV wrote: > Okay, I have created a Google Doc of my proposal. I have greatly > elaborated on the idea. I have enabled commenting for anyone with the > link. Please take a look and let me know either in this forum or in > the Google Doc if

Proposal: Signal connection via "my_app.MyModel"

2012-05-09 Thread Yo-Yo Ma
I'd like to suggest adding the ability to connect signals with models by app label and model name. Example API: post_save.connect( my_signal_handler, sender='my_app.MyModel' ) This would allow for better decoupling of code, as well as a far cleaner dependency graph. I'm not certain how

Re: Proposal: Signal connection via "my_app.MyModel"

2012-05-11 Thread Yo-Yo Ma
I'd be willing to implement this, with some guidance. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to

Re: Proposal: Signal connection via "my_app.MyModel"

2012-05-13 Thread Yo-Yo Ma
without having to worry about import order or errors, due to some crisscross in app A's dependency graph. On May 12, 4:24 am, Dougal Matthews <douga...@gmail.com> wrote: > On 9 May 2012 22:14, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > > This would allow for better decou

Bug (in 1.4+) double slash in URL leads to incorrect ``request.build_absolute_uri()``

2012-05-13 Thread Yo-Yo Ma
A request to: http://www.example.com:8080//foo-bar-baz.html leads to request.build_absolute_uri() returning: http://foo-bar.html -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to

Re: Bug (in 1.4+) double slash in URL leads to incorrect ``request.build_absolute_uri()``

2012-05-14 Thread Yo-Yo Ma
ar reason that you're > reporting this here, rather than on the ticket tracker? > > Yours, > Russ Magee %-) > > > > > > > > On Mon, May 14, 2012 at 9:55 AM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > A request to: > > >    http://www.example.co

Re: Bug (in 1.4+) double slash in URL leads to incorrect ``request.build_absolute_uri()``

2012-05-15 Thread Yo-Yo Ma
here, rather than on the ticket tracker? > > Yours, > Russ Magee %-) > > > > > > > > On Mon, May 14, 2012 at 9:55 AM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > A request to: > > >    http://www.example.com:8080//foo-bar-baz.ht

Re: Bug (in 1.4+) double slash in URL leads to incorrect ``request.build_absolute_uri()``

2012-05-16 Thread Yo-Yo Ma
Thanks Aymeric, I've reopened the ticket. I skipped the triage page, thinking it would be about the rules for prioritizing bugs. On May 15, 3:44 pm, Aymeric Augustin <aymeric.augus...@polytechnique.org> wrote: > Hello, > > On 15 mai 2012, at 21:36, Yo-Yo Ma wrote: > > &

Proposal: Add some extensibility / decoupling features to Django templates

2012-06-23 Thread Yo-Yo Ma
I'll start with an example: Using Jinja2, I can create an environment which is pretty secure (no access to anything but built-ins and objects explicitly marked "safe"), and provide a loader who's templates are loaded from the database (e.g., ``request.client.template_set.all()``), and

Docs mistake

2012-08-20 Thread Yo-Yo Ma
At: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to The docs make mention of the "url" attribute being MEDIA_ROOT + upload_to. I think whoever wrote it meant that the aforementioned is how the file name/path is determined, and that also MEDIA_URL +

Re: Proposal: Signal connection via "my_app.MyModel"

2012-08-21 Thread Yo-Yo Ma
Is there anyone else out there who doesn't like having to import models from app X into app Y just so that app Y can connect post save signals to them? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web

iPython behaves strangely only with Django shell

2012-08-29 Thread Yo-Yo Ma
The following gist demonstrates a strange phenomenon, which occurs when I use ``python manage.py shell``, but not when I use ``ipython`` alone. https://gist.github.com/f8c2fd97647de90d915a I'm not certain whether this is a known issue, or whether it's even a Django bug, but certainly nothing

Re: Models.py not loaded at server startup ?????

2012-09-02 Thread Yo-Yo Ma
Another good reason for model loading at startup is a good idea; without it, models.get_models becomes a lie. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit

``models.BooleanField`` fields default to ``False`` when missing from fixtures

2012-09-23 Thread Yo-Yo Ma
This may be the intended behavior, but I couldn't find docs on it. My recommendation would defer to "The Zen of Python" In the face of ambiguity, refuse the temptation to guess. I would rather see the typical IntegrityError: Problem installing fixture... -- You received this message

Re: ``models.BooleanField`` fields default to ``False`` when missing from fixtures

2012-09-24 Thread Yo-Yo Ma
ptember 24, 2012 5:44:29 AM UTC-4, Aymeric Augustin wrote: > > 2012/9/24 Yo-Yo Ma <baxters...@gmail.com > > >> This may be the intended behavior, but I couldn't find docs on it. My >> recommendation would defer to "The Zen of Python" >> >> In the

Re: ``models.BooleanField`` fields default to ``False`` when missing from fixtures

2012-09-24 Thread Yo-Yo Ma
Developer of a pet shop software adds: feed_before_midnight = models.BooleanField() because they're planning on carrying baby gremlins... forgets to update the zoological XML feed importer to use the "feed_before_midnight" value, and the rest is history :) On Monday, September 24, 2012

Re: ``models.BooleanField`` fields default to ``False`` when missing from fixtures

2012-09-24 Thread Yo-Yo Ma
isn't set, ``False`` is implied - only because this seems like the sort of mini-"bug" that might never warrant fixing due to the ramifications. On Monday, September 24, 2012 9:18:34 PM UTC-4, Russell Keith-Magee wrote: > > On Tue, Sep 25, 2012 at 8:00 AM, Yo-Yo Ma <b

Optimization request - give ``request.session`` lazy read

2012-09-30 Thread Yo-Yo Ma
With ``contrib.sessions`` installed and ``SessionMiddleware`` in use, I noticed that when Django session cookie is set the ``django_session`` table is queried on every request, regardless of whether any session data is used during the request cycle. Making the ``session`` attribute of request a

Re: URL dispatcher slow?

2012-10-11 Thread Yo-Yo Ma
Why does every conversation about Django's performance met with "GTFO we don't care"? (that was a rhetorical question :). I'd venture to guess that most "It's fast enough for me!" responses are predicated on experiences that can be likened to personal blog development, rather than large scale,

Re: URL dispatcher slow?

2012-10-11 Thread Yo-Yo Ma
I only now realized that this thread had started in a bit of a trolling fashion, and that there was a similar thread this week. That helps to explain the slightly more defensive stance. Django can survive (and thrive) just fine in its current, reasonably performant state, but performance

Re: save() method could return the object

2012-10-12 Thread Yo-Yo Ma
+1 A lot of people are overriding ``save`` and not returning anything, but this isn't going to hurt them (ideally, they should already be returning the result of ``super(``, but nobody does). On Friday, October 12, 2012 9:25:46 AM UTC-4, Chris Wilson wrote: > > Hi all, > > If the save()

Proposal - ``Model.reset_state``

2012-10-15 Thread Yo-Yo Ma
Problem: a = A.objects.get(...) form = AModelForm(data={...}, instance=a) if form.is_valid(): a = form.save() else: a.calculate_foo_field() a.last_attempt = datetime.now() a.save() # Oops, now the instance has the bad data provided to the form Workarounds: # Get a fresh

Complicated, strange bug in ``prefetch_related`` when used in the context of a test client

2012-10-28 Thread Yo-Yo Ma
I'm still working on forming some sort of understanding of what exactly causes this and/or what is even going on, so any help is much appreciated. The resultant attached "bars" in the following example: queryset = Foo.objects.all() queryset = queryset.prefetch_related('bars__baz')

Re: Complicated, strange bug in ``prefetch_related`` when used in the context of a test client

2012-10-29 Thread Yo-Yo Ma
Hi Anss, thanks for the reply. The queries are identical. That's the exact reason I posted. Those two examples should essentially be the same, save for some sort of operator overloading. My note at the bottom about providing an empty list instead of the related cache when calling

Re: Github tags

2012-10-29 Thread Yo-Yo Ma
+1 On Monday, October 29, 2012 5:18:48 AM UTC-4, Jan Bednařík wrote: > > There is also related ticket https://code.djangoproject.com/ticket/19141 > > Jan > > > On Mon, Oct 29, 2012 at 3:36 AM, Matt Austin > > wrote: > > Hi, > > > > Would it be possible to get tags

Django 2.0 - a case for a customizable pony

2012-12-04 Thread Yo-Yo Ma
This morning read the SQLAlchemy proposal made by Luke Plant in June. I then decided that this would be a good time to rant about abstraction, extensibility, and decoupling. Background For years, Django has been forced to deal with most implementation issues from within,

Re: [ANNOUNCE] Security releases (Django 1.3.5, Django 1.4.3, Django 1.5 beta 2)

2012-12-11 Thread Yo-Yo Ma
Tom, Create a view that accepts a "uri" argument and returns a 302 to the provided URI. Then, update your redirect_to callable to urlencode the URI and send them to /your/redirect/view/?uri=[encoded URI] and problem solved. -- You received this message because you are subscribed to the

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Yo-Yo Ma
-1 FWIW Computing the root of your project with os.path works just fine and doesn't require another setting... which, btw, could have no sane default. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web

Re: Github tags

2013-01-17 Thread Yo-Yo Ma
Sorry to be a pest, but will you guys end up adding a Git tag for RC-1? On Sunday, October 28, 2012 10:38:00 PM UTC-4, Matt Austin wrote: > > Hi, > > Would it be possible to get tags for 1.3.3, 1.3.4, 1.4.2, and 1.5 > alpha tagged on the github repository? The tagging seems to have > fallen

Re: Form.set_data method

2013-01-31 Thread Yo-Yo Ma
With all respect, this seems like a bad idea; there would be little, if any, gain from having this method. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Ticket #17093 -- quarantine global state in django.template

2013-02-08 Thread Yo-Yo Ma
For anyone developing a SaaS that allows users to create templates through the UI (e.g., a hosted CMS), separately initializable template system is paramount, giving the ability to modify multiple settingsin the template system that are in effect during template rendering, including loaders,

Form validation - char field coerces *any* data into a unicode

2013-02-09 Thread Yo-Yo Ma
A form that has a char field (e.g. "name") when provided a dict of data will convert the value of "name" to a Unicode, no matter what. I understand that this is desirable in some circumstances, but it can lead to things like: >>> product.name u"{'haha': 'I am a dict'}" Perhaps this is

Re: Form validation - char field coerces *any* data into a unicode

2013-02-09 Thread Yo-Yo Ma
I should note, the use case for this is when the data is being provided to the form through a mechanism other than normal HTTP form-encoded via request.POST, such as an API that consumes JSON. >>> product.name > u"{'haha': 'I am a dict'}" > > -- You received this message because you are

Policy for stable/1.x.x branches

2013-03-28 Thread Yo-Yo Ma
The commit https://github.com/django/django/commit/2f121dfe635b3f497fe1fe03bc8eb97cdf5083b3 fixed a problem where a custom regex validator's customized message was ignored, in favor of the one set on the class (you just see "Please enter a valid value"). If I pip install the latest master,

Re: Policy for stable/1.x.x branches

2013-03-28 Thread Yo-Yo Ma
ll the tip of master and test it out before updating, but that's not ideal of course. On Thursday, March 28, 2013 12:34:56 PM UTC-4, Yo-Yo Ma wrote: > > The commit > https://github.com/django/django/commit/2f121dfe635b3f497fe1fe03bc8eb97cdf5083b3fixed > a problem where a cu

Re: Policy for stable/1.x.x branches

2013-03-29 Thread Yo-Yo Ma
Ah, thanks Jacob. Also, great job on the 1.5.1 release. Thanks to everyone for all the hard work. On Thursday, March 28, 2013 12:34:56 PM UTC-4, Yo-Yo Ma wrote: > > The commit > https://github.com/django/django/commit/2f121dfe635b3f497fe1fe03bc8eb97cdf5083b3fixed > a problem wh

Testing project code that resides outside of installed apps

2013-03-30 Thread Yo-Yo Ma
A common pattern for larger applications is to maintain bits of reusable code outside of applications, but still inside of a project (e.g., myproject/lib), due to synchronous development and modification of application and library code. They're parts that aren't really large enough to warrant

Re: Testing project code that resides outside of installed apps

2013-03-31 Thread Yo-Yo Ma
That's excellent news! Thanks, Carl. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this

unittest2 discovery proposal

2013-04-01 Thread Yo-Yo Ma
+1, in general. >> ** The current "myapp." notation is not part of unittest2, and >> would go away I don't know of anyone for whom this would represent a breakage in deployment processes, since it's usually used for quick local testing only. One concern, however: How will `django-admin.py

value|localize possibly breaking timezone display in templates

2013-04-10 Thread Yo-Yo Ma
If you include {{ object.some_datetime }} with the America/New_York timezone activated in a template and get: April 10, 2013, 10:00 p.m. Then, take the same object, timezone, etc., and add the |localize filter - {{ object.some_datetime|localize }} - you'll get: April 11, 2013, 2:00 a.m. It

Should saving a model with foreign keys referencing unsaved models raise an error?

2013-04-24 Thread Yo-Yo Ma
The following example can throw a wrench in things, if you don't catch it right away, since it fails silently. >>> instance.some_fk_field = unsaved_instance >>> instance.save() The following example bit somebody I worked with a couple years back as well. >>>

Re: test discovery

2013-05-10 Thread Yo-Yo Ma
Wow, this is awesome! Thanks so much guys. Too long have I dreamt of the day when I could include tests for my "lib" and "util", etc. without having to couple them to one app or another. I'm so excited that this was added so quickly. Thanks Yo-yo -- You received this message because you

Re: Perception of attitude in tickets

2013-05-13 Thread Yo-Yo Ma
> > How about allowing comments only from the patch author and committers? > The problem I see with this is that original bug reporters, aside from the aforementioned groups, are usually the ones most engaged in these comments, and eliminating them from the process will only serve to further

Re: Perception of attitude in tickets

2013-05-13 Thread Yo-Yo Ma
There is a fundamental problem here, albeit one that is rooted in simple misunderstanding. The burden of proof is on the originator of an idea (i.e., the ticket reporter). Arguments can be made against the idea in the ticket. Rebuttal is sent elsewhere. Regardless of the intention, this

Meta-Proposal: Write *above* quotations in mailing list replies

2013-06-04 Thread Yo-Yo Ma
If you're posting to this list by logging in to https://groups.google.com/ rather than via email, I'd like to propose that you write your reply above the quoted message to which you're replying. If you do this, the digest emails that most subscribers get will be easily previewable from their

Re: Meta-Proposal: Write *above* quotations in mailing list replies

2013-06-04 Thread Yo-Yo Ma
reiterate, in email digests the latter format results in the reply not even being included in the email. Since this is a mailing list, it's sometimes useful to be able to actually read a digest of it it in your email. Cheers Yo-Yo On Tuesday, June 4, 2013 1:28:47 PM UTC-4, Javier Guerra w

Circularly dependent fixtures fail with Postgres 9.2

2013-06-16 Thread Yo-Yo Ma
There doesn't appear to be a way to load fixtures from JSON (using Postgres - works fine in sqlite3) for the following models: class Collection(models.Model): main_thing = models.OneToOneField( 'things.Thing', null=True, on_delete=models.SET_NULL ) class

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-21 Thread Yo-Yo Ma
f models (which you have done) > and simple fixture (which you haven't) that fails reliably, we have a new > bug on our hands, and you should open a ticket with all the details you can > provide. Confirming whether this is a problem with the alpha, or an ongoing > problem would also

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-21 Thread Yo-Yo Ma
Pardon one typo: I meant `python manage.py loaddata test_data` in my previous post. On Friday, June 21, 2013 4:32:33 PM UTC-4, Yo-Yo Ma wrote: > > Hi Russel, > > Thanks for taking the time to explain that. I tried that same day to > reproduce the issue in a testing env with

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-23 Thread Yo-Yo Ma
4 PM UTC-4, Yo-Yo Ma wrote: > > Pardon one typo: I meant `python manage.py loaddata test_data` in my > previous post. > > On Friday, June 21, 2013 4:32:33 PM UTC-4, Yo-Yo Ma wrote: >> >> Hi Russel, >> >> Thanks for taking the time to explain that. I tried that

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-23 Thread Yo-Yo Ma
:24:40 PM UTC-4, Yo-Yo Ma wrote: > > Hi again Russell, > > I did a little digging. I'm not sure, but I may have uncovered the > problem. A transaction block (using `commit_on_success_unless_managed`) is > entered and exited during each fixture object loaded, due to the calls to &g

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-25 Thread Yo-Yo Ma
I should actually note, this bug affects all versions of Postgres, and presumably all other supported RDBMSs as well. On Sunday, June 23, 2013 7:35:45 PM UTC-4, Yo-Yo Ma wrote: > > Minor correction: I placed Atomic.__exit__ to verify - the transaction is > commited every time

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-25 Thread Yo-Yo Ma
it doesn't, > it's a regression introduced by the new transaction management in Django > 1.6, and it's a release blocker. > > -- > Aymeric. > > > > On 25 juin 2013, at 22:30, Yo-Yo Ma <baxters...@gmail.com > > wrote: > > I should actually note, this bug

Re: Circularly dependent fixtures fail with Postgres 9.2

2013-06-28 Thread Yo-Yo Ma
> > -- > Aymeric. > > On 26 juin 2013, at 02:43, Yo-Yo Ma <baxters...@gmail.com > > wrote: > > > It does happen in 1.5, but the error is somehow slightly different (no > traceback in 1.5 to find the root cause). I have 2 fields on the order > model poi

UnicodeDecodeError in template rendering due to ’ (angled apostrophe)

2010-08-24 Thread Yo-Yo Ma
I just downloaded trunk about 2 hours ago, and I have a template that has a ’ character (angle style apostrophe that happens if you type something like "This doesn't work" in Fireworks (turns to "This doesn’t work" in Abobe Fireworks). When rendering a static page consisting of only the template,

Re: UnicodeDecodeError in template rendering due to ’ (angled apostrophe)

2010-08-24 Thread Yo-Yo Ma
Perhaps it isn't a bug in Django. My document's encoding is Western European (CP-1252). Is this typical, or should I manually choose ASCII? On Aug 24, 6:35 pm, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > I just downloaded trunk about 2 hours ago, and I have a template t

Re: UnicodeDecodeError in template rendering due to ’ (angled apostrophe)

2010-08-24 Thread Yo-Yo Ma
use Adobe Fireworks. > > Also, this is more appropriate for the django-users group, django-dev is for > discussion of development of Django itself, not development of sites that > use Django. > > > > On Tue, Aug 24, 2010 at 8:35 PM, Yo-Yo Ma <baxterstock...@gmail.com> w

Re: UnicodeDecodeError in template rendering due to ’ (angled apostrophe)

2010-08-24 Thread Yo-Yo Ma
ly sure why you're creating templates with it. > > On Tue, Aug 24, 2010 at 8:41 PM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > @Josh - really helpful. Thanks. So, if Django had a bug pertaining to > > character encoding, it wouldn't be appropriate for me to report i

Feature request - extend multiple templates

2010-08-25 Thread Yo-Yo Ma
Let's say I have a site with 5 sections, 6 main tabs per section, and 7 sub tabs per main tab. In order to display the correct tabs for a given view, I have to have: baseform.html baselist.html foo_section/form.html foo_section/list.html foo_section/spam_sub_section/form.html

Any interest in adding a navigation helper to Django?

2010-08-26 Thread Yo-Yo Ma
I'm speaking about something like http://code.google.com/p/django-nav/ One of the main issues I deal with when developing software with Django is that I need to create a new template for every view that changes navigation (e.g. tabs). The ability to generate some sort of a map that allows for

Re: Any interest in adding a navigation helper to Django?

2010-08-26 Thread Yo-Yo Ma
You know what, I thought this hadn't been updated for 3 years because the downloads section isn't updated. I didn't bother to browse the SVN for change dates. Thanks Dougal. Rog On Aug 26, 10:32 am, Dougal Matthews <douga...@gmail.com> wrote: > On 26 August 2010 17:25, Yo-Yo Ma <

Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
I'm sure this will be met with criticism, but there is a reason why just about all template languages allow the setting of variables. It allows you to do things like: {% for thing in things %} {{ thing }} {% if thing.is_the_one %} {% set_var the_one thing%} {% endif %} {%

Re: Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
this with the "with" > statement:http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=old... > > On Fri, Aug 27, 2010 at 10:06 AM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I'm sure this will be met with criticism, but there is a reason wh

Re: Feature request - set variables in template

2010-08-26 Thread Yo-Yo Ma
me feel better. Thanks a lot for ruining my evil plans :) On Aug 26, 6:30 pm, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Fri, Aug 27, 2010 at 8:06 AM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I'm sure this will be met with criticism, but there is a reason w

Re: Any interest in adding a navigation helper to Django?

2010-08-27 Thread Yo-Yo Ma
I think the thing that would be helpful to most django users is bit really a navigation helper per se. I think what I need could be solved with a more generic tool. Russell, tell me what you think about providing a way to make a view a "child" of another. I'm not speaking in the CMS sense (e.g.

Re: Any interest in adding a navigation helper to Django?

2010-08-28 Thread Yo-Yo Ma
ith-magee.com> wrote: > On Sat, Aug 28, 2010 at 12:32 PM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I think the thing that would be helpful to most django users is bit > > really a navigation helper per se. I think what I need could be solved > > with a mor

Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
I think it might be a good idea to document the direct usage of the FileField, and ImageField model fields. The docs make the assumption that everyone is using ModelForm to upload files. If I have a file on my hard drive and want to use it to populate the field, I would try something like:

Re: Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
BTW, ignore the PIL imports On Sep 15, 12:28 pm, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > I think it might be a good idea to document the direct usage of the > FileField, and ImageField model fields. > > The docs make the assumption that everyone is using ModelForm to &g

Re: Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
-Magee <russ...@keith-magee.com> wrote: > On Thu, Sep 16, 2010 at 2:28 AM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I think it might be a good idea to document the direct usage of the > > FileField, and ImageField model fields. > > Sure -- sounds like a reasona

Inclusion of easy-thumbnails into Django Contrib

2010-09-15 Thread Yo-Yo Ma
Is there any plans to incorporate http://github.com/SmileyChris/easy-thumbnails/ into django.contrib? I have seen so many apps/libraries come into and go out of existence (http://code.djangoproject.com/wiki/ThumbNails for instance mentions sorl-thumbnails which is no longer being developed). I

Re: Inclusion of easy-thumbnails into Django Contrib

2010-09-16 Thread Yo-Yo Ma
akovic > > <davidnovako...@gmail.com> wrote: > > I don't want to sound negative, but answering your own question before > > anyone else can doesn't change the answer ;) > > > D > > > On Thu, Sep 16, 2010 at 3:00 PM, Yo-Yo Ma <baxterstock...@gmail.com> w

Re: Inclusion of easy-thumbnails into Django Contrib

2010-09-16 Thread Yo-Yo Ma
place for it to go > along with the other batteries in the pack. > > > > On Thu, Sep 16, 2010 at 12:24 PM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I have no data to support the following assertion, but it's not too > > unreasonable: More people probably need thumb

Re: Inclusion of easy-thumbnails into Django Contrib

2010-09-16 Thread Yo-Yo Ma
t people's needs for > > image manipulation within a web development environment, and being in > > contrib will allow people to use another package if they don't like it. > > > On Thu, Sep 16, 2010 at 12:37 PM, Yo-Yo Ma <baxterstock...@gmail.com>wrote: > &g

Re: Inclusion of easy-thumbnails into Django Contrib

2010-09-16 Thread Yo-Yo Ma
> >>> -Preston > > >>>> On Sep 16, 2010, at 11:33 AM, Brian O'Connor wrote: > > >>>> > I have absolutely no pull in decision making, but maybe my message > >>>> > will count towards a "community voice". > > &

Possible bug discovered

2010-09-19 Thread Yo-Yo Ma
I got a printout of a stack trace on a white screen: I don't know how I can help you guys find the bug since I have zero context with this stack trace, but hopefully it helps. Traceback (most recent call last): File "C:\Python26\Lib\site-packages\django-trunk\django\core\servers

Re: Possible bug discovered

2010-09-19 Thread Yo-Yo Ma
Django version: 13858 -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com.

'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
I think I've found a bug in auth.login. user = User.objects.get(username=request.POST.get('username', '')) if user.check_password(request.POST.get('password', '')): login(request, user) This raises the following exception: Exception: 'User' object has no attribute 'backend'

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
backend' On Sep 23, 12:53 pm, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > Hi -- > > On Thu, Sep 23, 2010 at 1:38 PM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I think I've found a bug in auth.login. > > Thanks for the report. > > However, for this to be

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
It should also be noted that I don't have installed "contrib.admin" as I don't need it. I hope that doesn't matter regarding a separate app, but I thought I'd mention it. On Sep 23, 12:53 pm, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > Hi -- > > On Thu, Sep 23,

Something.is_live instead of implementation specific is_live settings

2010-09-23 Thread Yo-Yo Ma
I'm simply proposing the idea of having the development server explicitly set something to indicate a "in development" status, so that if that does not exist you can make the assumption that the project is live. I don't like having to check for specific things like to see if I'm in live or

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
you can show that it is actually a problem with django and not > the way you are using it, it'd be better addressed on django-users > first. > > David > > On Fri, Sep 24, 2010 at 5:41 AM, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > > On Thu, Sep 23, 2010 at 2:18 PM, Yo-Yo Ma &l

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
Btw, yes I am aware of the paragraph below explaining the confusing dilemma. That's how I fixed my issue. Thank you Santiago. On Sep 23, 5:02 pm, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > It is a problem with Django. I thought it was a problem with the code > but it isn't. It

Re: Something.is_live instead of implementation specific is_live settings

2010-09-23 Thread Yo-Yo Ma
: > As for running different configs: > > manage.py runserver --settings=settings_test > > etc.. > > On Fri, Sep 24, 2010 at 7:25 AM, Jacob Kaplan-Moss <ja...@jacobian.org> wrote: > > On Thu, Sep 23, 2010 at 3:33 PM, Yo-Yo Ma <baxterstock...@gmail.com>

Re: Something.is_live instead of implementation specific is_live settings

2010-09-23 Thread Yo-Yo Ma
Kaplan-Moss <ja...@jacobian.org> wrote: > On Thu, Sep 23, 2010 at 3:33 PM, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > > I'm simply proposing the idea of having the development server > > explicitly set something to indicate a "in development" status, so > &

Re: Something.is_live instead of implementation specific is_live settings

2010-09-23 Thread Yo-Yo Ma
t; > I think most people use whatever system they are happy with and it > > doesn't get in the way of deployment/development. Thus this fails to > > meet one of the critical requirements for consideration for inclusion > > into core. > > > D > > > On Fri, Sep 24, 2010

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-23 Thread Yo-Yo Ma
gt; > adding it to the list of auth backends and letting authenticate() > > provide the actual authentication. > > > So yep, unfortunately this is an issue for django-users. > > > David > > > On Fri, Sep 24, 2010 at 9:02 AM, Yo-Yo Ma <baxterstock...@gmail.com>

Re: Something.is_live instead of implementation specific is_live settings

2010-09-24 Thread Yo-Yo Ma
s live just example. I'm not suggesting "project" as a global. It's just to show the type of setting I want. That's much cleaner, and far more explicit than "import os, socket, etc". On Sep 23, 7:41 pm, Yo-Yo Ma <baxterstock...@gmail.com> wrote: > Thanks for the link D

Re: Something.is_live instead of implementation specific is_live settings

2010-09-24 Thread Yo-Yo Ma
ept ImportError: >    pass > > 2) > if DEBUG: >     from dev_settings import * > > Because to have "project.is_dev" you'll have to write it somewhere already! > > It's bootstrapping problem. > > > > > > On Sat, Sep 25, 2010 at 12:01 AM, Yo-Yo Ma <bax

Re: Something.is_live instead of implementation specific is_live settings

2010-09-24 Thread Yo-Yo Ma
t; status somehow. Some options: > > - check the absolute path of the settings file on the filesystem if you can > > ensure this path is different on the production server > > - import socket; and check socket.gethostname() > > - check for "runserver" in sys.argv &

  1   2   >