(@HannaKollo, @codeinthehole)
This:
1 def my_view(request):
2 params = request.GET
3 # Lot of code here before returning HttpResponse
4 # ...
5 return HttpResponse("This is a too big view")
could be:
1 from my_project.services import deal_with_data
2
3 def my_view(request):
4 params = request.GET
5 deal_with_data(params)
6 return HttpResponse("We have separated business from view logic")
(@magopian, @RaeKnowler)
Added value compare to manage test:
Use randomised data and find edge cases for you
1 @given(floats())
2 def test_negation_is_self_inverse(x):
3 assert x == -(-x)
(@olasitarska)
(@erikpub, @ubernostrum)
(@asendecka, @thomaswturner)
Unbelievable stack (Django, C++, Firebird, CEF, Sikuli)
(@piquadrat_ch)
(@aaronbassett)
(@akaariai)
1 class Dog(models.Model):
2 data = HStoreField()
3
4 Dog.objects.create(data={'breed': 'labrador', 'owner': 'Bob'})
5 Dog.objects.filter(data__breed='collie')
1 class Post(models.Model):
2 tags = ArrayField(models.CharField(max_length=200), blank=True)
3
4 Post.objects.create(name='First post', tags=['thoughts', 'django', 'd'])
5 Post.objects.filter(tags__contains=['django', 'thoughts'])
Encrypt/decrypt files on GitHub
Initialise your repository:
!shell
git-crypt init
Create a .gitattributes file to encrypt (in this example) .key files
!text
secretfile filter=git-crypt diff=git-crypt
*.key filter=git-crypt diff=git-crypt
Django project templating
Convert LaTeX documents to data saved in database, and render it through Django.
Table of Contents | t |
---|---|
Exposé | ESC |
Full screen slides | e |
Presenter View | p |
Source Files | s |
Slide Numbers | n |
Toggle screen blanking | b |
Show/hide slide context | c |
Notes | 2 |
Help | h |