I want to customize django form labels in this way:
____
Time: |____| (min)
How can I do this? Thanks in advance.
Try the help_text field : https://docs.djangoproject.com/en/dev/ref/forms/fields/#help-text
Related
If city__c is equal to hyd panCard, phone,email blank through error.
i don't know if i understood your question correctly. Try it with:
AND(
city__c = 'hyd panCard',
ISBLANK(phone),
ISBLANK(email)
)
I am new to Laravel and working on existing code.
I want to pass some values in url in format of URL/val1/val2/val3.
Every thing is working perfect if all values with normal string or number
but if any value has special character like slash / or \ it shows errors.
eg.
working :- URL/abc/pqr/xys
but if val3 = 22/06 ;url is URL/val1/val2/22/06 error shows 404 not found
If I encoded val3 using javaScript's function encodeURIComponent()
val3=22%2F06 and url become URL/val1/val2/22%2F06 shows Object not found!
// My current route web.php is:-
Route::get('/export/{name}/{status}/{search}', 'ReportController#export')->name('export');
//routes.php
Route::get('view/{slashData?}', 'ExampleController#getData')
->where('slashData', '(.*)');
Your route accept only 3 params. But you pass four params.
Route::get('/export/{name}/{status}/{search}', 'ReportController#export')->name('export');
You must change your val3=22-06. Don't use / as value of your param.
Eg.
URL/val1/val2/22-06
You need to use regex expression for that situation:
Route::get('/export/{name}/{status}/{search}', 'ReportController#export')->name('export')->where(['search' => "[\w\/]+"]);
Is there a way to escape a "?" in a eloquent whereRaw Statement? (Using laravel 6.x)
example:
ExampleModel::whereRaw(' "table"."json_field"::jsonb ?| array[\'test\', \'test2\'] ')->get();
This gets sent to the db as
where "table"."json_field"::jsonb $1| array['test', 'test2']
And well, thats not what i wanted to query...
Tried with '\?', put it in a binding (Laravel doc) - still no success.
Also i didn't find a reference in the docs ...
In my Usecase i want it to compare a json object with the psql comparing "?|" (Postgres Doc)
Thanks in advance!
the question is pretty old but my answer might help anyway.
The solution is very simple: just escape the questionmark with another questionmark.
The code of your example would look like this:
ExampleModel::whereRaw(' "table"."json_field"::jsonb ??| array[\'test\', \'test2\'] ')->get();
This solution has been tested with Laravel 7.28.3.
Didn't test but try using PDO:
$whereRaw = DB::connection()->getPdo()->quote(' "table"."json_field"::jsonb ?| array["test", "test2"] ');
ExampleModel::whereRaw($whereRaw)->get();
Well, didn't find an answer, but a workaround:
Don't use the question mark operators!
Instead i went for the named function. I found the named function via
SELECT
oprname,
oprcode || '(' || format_type(oprleft, NULL::integer) || ', '
|| format_type(oprright, NULL::integer) || ')' AS function
FROM pg_operator
WHERE oprname = '?|';
( Found there: big thanks to this guys post!)
So my Eloquent query now looks like:
ExampleModel::whereRaw('jsonb_exists_any("table"."json_field"::jsonb, array[\'test\', \'test2\'])')->get();
At least its working ¯\_(ツ)_/¯
As part of an email step in our Flow, we are creating an HTML table, where certain rows are hidden using css.
So our expression formula (in the body of the Outlook - Send an email from a Shared Mailbox step looks like this:
if(
And(
Or(
equals(triggerBody()['DD_Artwork']['Value'], 'Bargain New Store')
, equals(triggerBody()['DD_Artwork']['Value'], 'Home & Fashion')
,equals(triggerBody()['DD_Artwork']['Value'], 'Home Store'))
, #empty(triggerBody()?['StoreOpeningDate']))
,'tr.StoreOpenDate {display:visible}', 'tr.StoreOpenDate {display:none}')
this part, checking the Date Selector field StoreOpeningDate is not working:
, #empty(triggerBody()?['StoreOpeningDate']))
we have also tried:
, Not IsBlank(triggerBody()?['StoreOpeningDate']))
and
, Not IsEmpty(triggerBody()?['StoreOpeningDate']))
and even:
, Not equals(triggerBody()?['StoreOpeningDate']), '')
but we always get the error message The expression is invalid
so what's the right way to go about this?
I faced a similar problem. The TriggerBody() function is doing the damage. Just use
Empty(item()?['DateField']) not equal to false in the condition.
I have a filter attribute in my controller which I want to bind to the corresponding DOM element.
So far, I am able to display filter value, doing:
%input type="text" value=filter
But what I want is to reflect input changes back to filter, with a bidirectional binding...
Any clue?
= input valueBinding="filter"
is cleaner.
view Ember.TextField valueBinding="filter"
= input value=filter
or even with a sub property :
=input value=object.property
both works.