Em JavaScript há uma comportamento chamado hoisting.
O uso de var trazia algumas pegadinhas, como por exemplo, declarar a mesma variável 2x usando var
var abc = 25
// ...
// ...
var abc = 99| #models.py | |
| class Task(models.Model): | |
| title = models.CharField(max_length=255) | |
| description = models.TextField() | |
| def __unicode__(self): | |
| return self.title |
| <button class="btn btn-success mybtn">Ocultar</button> | |
| <p>Com o comando <code>fadeToggle()</code> podemos ocultar ou mostrar um elemento.</p> |
Em JavaScript há uma comportamento chamado hoisting.
O uso de var trazia algumas pegadinhas, como por exemplo, declarar a mesma variável 2x usando var
var abc = 25
// ...
// ...
var abc = 99| import xlwt | |
| def export_xls(model_='User', file_name='export.xls', queryset=None, columns_=None): | |
| response = HttpResponse(content_type='application/ms-excel') | |
| response['Content-Disposition'] = 'attachment; filename="%s"' % file_name | |
| wb = xlwt.Workbook(encoding='utf-8') | |
| ws = wb.add_sheet(model_) |
THINKUp#11 - Do zero ao Deploy em 2h com Django + PythonAnywhere
https://www.pythonanywhere.com/
Tutorial: https://github.com/rg3915/tutoriais/tree/master/django-basic
Base: https://github.com/rg3915/djangotutorial
Nosso projeto: https://github.com/rg3915/thinkup-djangotutorial
| // https://github.com/beautify-web/js-beautify#css--html | |
| { | |
| "html": { | |
| "wrap-attributes": "force-expand-multiline" | |
| }, | |
| "end_with_newline": true, | |
| "indent_level": 2, | |
| } |
| <!-- https://getbootstrap.com/docs/4.0/getting-started/introduction/#starter-template --> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link rel="shortcut icon" href="https://www.djangoproject.com/favicon.ico"> | |
| <!-- <link rel="shortcut icon" href="http://html5-training-in-hyderabad.blogspot.com.br/favicon.ico"> --> | |
| <title>Django Example</title> | |
| <!-- Bootstrap core CSS --> |
| $(function() { | |
| // Edit money | |
| $('.money-edit').on('click', function() { | |
| let obj = $(this).closest('tr').children('td') | |
| // get the length of array (obj) | |
| let totalLen = obj.length | |
| obj.each(function(i, e) { | |
| var item_v = $(this).text() |
| <!-- Modal --> | |
| <div id="myModal" class="mymodal"> | |
| <!-- Modal content --> | |
| <div class="mymodal-content"> | |
| <div class="mymodal-header"> | |
| <h4>Título</h4> | |
| </div> | |
| <div class="mymodal-body"> | |
| ... | |
| </div> |