Skip to main content

Posts

Showing posts with the label tags

Git tag and versioning your project

We use tags to version our project. I will set up here basic commands we use on everyday basis and may use to handle some issues. Showing your tags Listing the available tags in Git is straightforward. Just type git tag . $ git tag 1 . 0 . 7 1 . 0 . 8 1 . 0 . 9 1 . 1 . 0 Adding tags To add tags you may do git tag tagname . But better to specify args to be able to use in scripts: $ git tag - a 1 . 1 . 1 - m "major improvements" $ git tag 1 . 0 . 7 1 . 0 . 8 1 . 0 . 9 1 . 1 . 0 1 . 1 . 1 Here we have added a tag version 1.1.1 with commit message "major improvements" . Uploading to repository I assume you have a GitHub repo. So to push your tags there run git push (for your tagged commits commits) and then push your tags: $ git push Counting objects : 120 , done. Delta compression using up to 4 threads. Compressing objects : 100 % ( 59 / 59 ) , done. Writing objects : 100 % ( 69 / 69 ) , 390 . 70 KiB , done. Total 69 (...

Templates. New in Django 1.4

Continuing those series of tasty features in Django 1.4. It's templates and newly added templatetags this time. Many things improved in template logic now. Lets move on point by point... Tag  {% elif %} For most of us it is almost killer feature of new Django 1.4. You will have simpler logic in your templates, if you have advanced logic there, of course. ;) Key-value arguments for user tags You can use key-value for tags along with old, positional, arguments, e.g.: { % custom_tag 123 "test" thing . var text = msg | upper username = user . get_full_name % } All of this implemented using common "args" and "kwargs": @register . simple_tag def custom_tag ( a , b , * args , * * kwargs ) : warning = kwargs [ 'text' ] profile = kwargs [ 'username' ] . . . return . . . assignment_tag Some tags are not built to output something in template, like simple_tag. They only have to change something in c...