Posts by mcmartin • 172 points
11 posts
- 
		0 votes1 answer336 viewsA: Modify only one React Hooks componentOn the map you described you are using check (that theoretically is a Boolean) to iterate. Use a variable to store the "id" (we can use the index if the positions are never changed) of the selected… 
- 
		0 votes2 answers54 viewsA: How to query a select that has two values?It is worth remembering that the parse of "['', '']" can be problematic and that codigo initially will be string. Here is the documentation $().each $('#iputTurno1').blur(function () { var codigo =… 
- 
		-1 votes2 answers161 viewsA: 'addeventlistener is not a Function', why does this occur?Try this // Touch Events carrosselPai[0].addEventListener("touchstart", handleStart, false); carrosselPai[0].addEventListener("touchmove", handleMove, false);… 
- 
		0 votes1 answer613 viewsA: Login to DjangoBefore you need to answer some questions, the user can be responsible for more than one group? (your template today allows). I’ll assume not, because if he’s responsible for two groups to which of… 
- 
		1 votes1 answer172 viewsA: Add 0 after the commaYou need to take a look at String Formatting Operations. I realize that you want to first exchange the dots by comma and then set the number of decimals. I suggest you do the opposite. First set the… python-2.7answered mcmartin 172
- 
		2 votes1 answer510 viewsA: Counter of recursion solutionsAt the beginning of your function add: global contador 
- 
		1 votes1 answer48 viewsA: How to change is_staff when I click href?This view you posted is related to url (register:authorize)? It seems not. So I’ll show you what a view would look like from scratch. The first step is to prepare your url to receive a parameter… 
- 
		1 votes1 answer74 viewsA: Problem with Django Cache Page/URLWhat you call a "problem" when using the @cache_page(60 * 15) Actually it’s not a problem it’s just him doing his job properly. I have no way to give a definitive solution to your case, but I can… 
- 
		0 votes2 answers368 viewsA: Django Rest compare user 'sector' id with publication 'sector' idThere’s more to the matter of permissiveness, as I understand it. So when the publishing sector is different from the user sector you want to refuse this request (and probably return an error… 
- 
		0 votes1 answer162 viewsA: Save user locationA complicated theme, the only solution I see is to use the Google Api to pick up the location (no matter what language) and save the one thing that is common to any language: coordinates! So when… 
- 
		1 votes1 answer1564 viewsA: How to use token to validate a Django Rest Framework user loginCreate a view for your login (this view is "ready" thanks to the framework, but if you wanted to customize you can.) 'obtain_jwt_token' will log in and return a token it expects the parameters in…