Blog

So here comes a simple template filter which checks if the user belongs to a given group. It can be easily extended to take into account more groups. – See more at: http://www.abidibo.net/blog/2014/05/22/check-if-user-belongs-group-django-templates/#sthash.i1cF0nIZ.dpuf 1 2 3 4 5 6 7 8 from django import template from django.contrib.auth.models import Group register = template.Library() @register.filter(name=‘has_group’) def has_group(user, […]

Adding locale switcher to templates Django comes with a view, django.views.i18n.set_language(), that sets a user’s language preference and redirects back to the previous page. This view ca be activated by adding URL like (r’^i18n/’, include(‘django.conf.urls.i18n’)), to urlconf (see Below example). In order to add locale switcher to your templates you will have to add a […]

Adding locale switcher to templates Django comes with a view, django.views.i18n.set_language(), that sets a user’s language preference and redirects back to the previous page. This view ca be activated by adding URL like (r’^i18n/’, include(‘django.conf.urls.i18n’)), to urlconf (see Below example). In order to add locale switcher to your templates you will have to add a form which will […]

Problem: Django imageField now shows image ( like <img src=”image_path.ext”/>), i want to display path as image Solution:  So that i create one utility.py file with 1 2 3 4 5 6 7 8 9 10 11 12 13 14 from django.contrib.admin.widgets import AdminFileWidget from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe class AdminImageWidget(AdminFileWidget):     def […]

WordPress Provides us corr function for thickbox, we can’t need extra plugins or css for example : 1 2 3 4 5 6 7 8 <?php add_thickbox(); ?> <div id=“my-content-id” style=“display:none; height:300px; width:400px;”>      <p>           This is my hidden content! It will appear in ThickBox when the link is clicked.      </p> </div> <a href=“#TB_inline?inlineId=my-content-id” […]

23

Dec 2014

Using Javascript and PHP creating repeater field as html form you can use the following example : HTML Add Repeat FieldPHP Coder Repeater Field
Add cast member
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 Coder Repeater Field

“>Film Script “>Character name “>Character Description

Remove
Add cast member
Enjoy Your self: Credit : CoderSantosh

jQuery Div content change event Listener Div content Change event listener JavaScript 1 2 3 $(‘#coder-final-prize’).bind(“DOMSubtreeModified”,function(){       alert(“changed”);   }); Enjoy

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 function openNewBackgroundTab(){     var a = document.createElement(“a”);     a.href = window.location.pathname;     var evt = document.createEvent(“MouseEvents”);     //the tenth parameter of initMouseEvent sets ctrl key     evt.initMouseEvent(“click”, true, true, window, 0, 0, 0, 0, 0,                                 true, false, false, false, 0, null); […]