On 7/12/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > A few comments (mostly questions) from an initial reading:
I've now implemented most of your suggestions [1]; a few questions remain, though: 1) If I'm going to import the taghelpers errors/API into django.template, I'll need to in turn move the content in django.template.__init__ into a submodule (django.template.main, perhaps), or I run into circular import madness. 2) I'm still not sure exactly how I should handle failed resolution if I simply resolve automatically; there are merits to each possible approach. a) Setting to None is more or less how Django currently does it, and doesn't provide any surprises. b) Setting to the string equivalent of the variable name is a useful trick, and what we do in several places internally by way of a "resolve_variable_or_literal" function; this in turn gave rise to the taghelpers "auto" resolution. Any suggestions here? (I suppose one solution would be to have a TagArg argument to choose between the two fallbacks.) 3) Regarding Brian Harring's #3453, the type conversion logic is redundant between his approach and mine. taghelpers already avoids the issue he's trying to bypass, as it performs type conversion in one initial sweep and stores the literal values for later. I'd rather not use his approach in taghelpers; I don't like the idea of passing around LiteralVariables when I can be passing around honest-to-${deity} integers, strings, etc. :-) Ideally, I'd like to yank the type conversion logic out of resolve_variable, as I believe type conversion and variable resolution are really two separate things and should be available separately as needed. I'm fine with a utility function that does both; I just want the logic available separately. Right now, the type conversion logic in resolve_variable is needlessly called from taghelpers since type conversion has already occurred. Ultimately, Brian's approach may be fine as an available default; I just want that resolution logic available separately for taghelpers, dammit. ^_^ [1] http://hg.korpios.com/django.korpios.patches/file/tip/taghelpers.patch --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---