Re: To keep or not to keep: logging of undefined template variables

2021-01-26 Thread Vlastimil Zíma
ual > implementation, but the basic idea is the same - move logging/raising > errors to an overridable function. > > Any thoughts on this would be much appreciated > > On Friday, August 25, 2017 at 11:50:27 AM UTC+1 Vlastimil Zíma wrote: > >> If anyone is interested, I&#x

Re: Allow namespaced reusable app urls as ROOT_URLCONF

2018-02-16 Thread Vlastimil Zíma
> > The issue was raised some months ago in > https://code.djangoproject.com/ticket/28413 and came to a similar > conclusion. The resolution was to document the restriction. > > On Thursday, February 15, 2018 at 10:57:54 AM UTC-5, Florian Apolloner > wrote: >> >> Hi, >> &g

Allow namespaced reusable app urls as ROOT_URLCONF

2018-02-15 Thread Vlastimil Zíma
Hi, I've tried to understand how to write an urls module for reusable app and I think I have it correctly: # myapp.urls app_name = 'myapp' urlpatterns = [ url(r'^index/$', MyIndexView.as_view(), name='index'), url(r'^form/$', MyFormView.as_view(), name='form'), ... ] In code I use

Missing one-to-one relation between MultiValueField fields and MultiWidget widgets

2018-01-29 Thread Vlastimil Zíma
Hi, I've been playing around with a field and widget for phone number having two, prefix and subscriber, inputs. I've noticed some HTML attributes, such as maxlength, which the widgets normally have, get lost in the MultiValueField/MultiWidget interface. The MultiValueField contains two parts

Re: To keep or not to keep: logging of undefined template variables

2017-08-25 Thread Vlastimil Zíma
astik Dne pátek 25. srpna 2017 9:28:30 UTC+2 Vlastimil Zíma napsal(a): > > Apparently there is number of errors in admin templates. I suggest to fix > the templates. I my experience, the most cases are missing if statements or > missing context variables. These can be fixed very e

Re: To keep or not to keep: logging of undefined template variables

2017-08-25 Thread Vlastimil Zíma
>> >> `` >> some_app/home.html:32:24: Undefined variable: *missing_variable* >> `` >> >> I'm unsure how much effort this would take, but it would definitely make >> the logging a lot more user + developer friendly. >> >> On 20 June 2017 at

Re: To keep or not to keep: logging of undefined template variables

2017-06-20 Thread Vlastimil Zíma
-1 to the removal. I was annoyed by the logging at first, but then I started to clean individual logs. Half way through, I found several usages of long removed variables, one unused template (as a side effect) and I updated several views to always provide defined context variables. All in all,

Re: should nonexistent template filter arguments resolve to string_if_invalid rather than raise VariableDoesNotExist?

2017-06-02 Thread Vlastimil Zíma
Django now reports invalid variable names by 'VariableDoesNotExist' exception, which is logged. So it is possible to track down invalid variable names. The problem I see here is inconsistency in handling invalid variable names. If invalid variable is rendered or used in an 'if' tag, it is silen

Re: Feature suggestion: Option to suppress system checks in commands

2016-10-04 Thread Vlastimil Zíma
dd the setting through and env variable and obtain that >> variable inside the settings file with >> SILENCED_SYSTEM_CHECKS = bool(os.environ.get("SILENCED_SYSTEM_CHEKS", >> false)) >> >> >> On Fri, Sep 30, 2016 at 11:31 AM Vlastimil Zíma wrote: >>

Feature suggestion: Option to suppress system checks in commands

2016-09-30 Thread Vlastimil Zíma
Hi everyone, I'd suggest an options for all commands to suppress a defined system checks when running a command. I know it is possible to defined SILENCED_SYSTEM_CHECKS in settings, but that has impact of everything including the check command itself. My point is to suppress system checks main

Swappable Flatpage model

2016-07-26 Thread Vlastimil Zíma
Hi, as there is several requests for extension of Flatpage model, it might be the easiest solution to make Flatpage model swappable as User model. Anybody else for this enhancement? References * Request for markdown support https://code.djangoproject.com/ticket/23743 * Request for flatpage re

Re: Allow impossible model validation (mainly admin and generic forms)

2015-11-26 Thread Vlastimil Zíma
General flow for forms should develop to this: form = MyModelForm(data) if form.is_valid(): try: form.save() except ValidationError, error: form.add_error(None, error) else: return redirect('success') return render_failure(form) While handling such case in cust

Re: Allow impossible model validation (mainly admin and generic forms)

2015-11-26 Thread Vlastimil Zíma
an IntegrityError from >> the database into an "friendly" exception for the user? >> >> On Wednesday, November 25, 2015 at 9:23:05 AM UTC-5, Vlastimil Zíma wrote: >>> >>> Django assumes that all input data in forms can be validated by >&g

Allow impossible model validation (mainly admin and generic forms)

2015-11-25 Thread Vlastimil Zíma
Django assumes that all input data in forms can be validated by `Form.is_valid()` which in some cases is not true. Database contraints, e.g. unique, can fail even though they are checked. An application may require communication with other servers while processing data which can lead to error

Re: Enable storing NULL in database

2013-11-12 Thread Vlastimil Zíma
box to > click to set the value to None/NULL. > > On Thursday, November 7, 2013 11:37:47 AM UTC+1, Vlastimil Zíma wrote: >> >> Hi everybody, >> >> I know this was here before, but it is really a problem. We need (I >> literally mean need, not just want) a sim

Re: Enable storing NULL in database

2013-11-08 Thread Vlastimil Zíma
. That would be a problem. What do you think? Vlastimil Dne čtvrtek, 7. listopadu 2013 13:55:54 UTC+1 Karen Tracey napsal(a): > > On Thu, Nov 7, 2013 at 5:37 AM, Vlastimil Zíma > > wrote: > >> I don't want to enforce anybody to use only NULL as empty value, I just >

Enable storing NULL in database

2013-11-07 Thread Vlastimil Zíma
Hi everybody, I know this was here before, but it is really a problem. We need (I literally mean need, not just want) a simple way to store NULL in database instead of ''. Using empty string has several serious consequences (in databases which distinguishes between NULL and '', which are to my

Re: Odp: Re: Storing language in session/cookie

2011-09-05 Thread Vlastimil Zíma
I just find out ticket #15902 while searching for completely different thing :) I support storing language into cookie only (as final state) for reasons we encountered in our applications: - Language is not forgotten when user logs out / is logged out. - When this happens with languge in se