This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from intranet.widgets import PhoneField | |
class Restaurant(models.Model): | |
phone = PhoneField(_(u'Téléphone de réservation'), help_text=_(u"Veuillez entrer votre numéro sous la forme : 03 90 87 65 43 ou +33.390876543")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
greetings/ | |
├── _design | |
│ └── greetings | |
│ └── views | |
│ └── all | |
│ └── map.js | |
└── greetings.py | |
4 directories, 2 files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.auth.models import User, AnonymousUser | |
from django.utils.importlib import import_module | |
class ObjectPermissionBackend(object): | |
supports_object_permissions = True | |
supports_anonymous_user = True | |
supports_inactive_user = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_to_valid_name(prefix_dir): | |
''' Create the right function ''' | |
def get_valid_name(instance, name): | |
from django.template.defaultfilters import slugify | |
from django.utils.encoding import smart_str | |
import os | |
n = name.rsplit('.',1)[0] | |
ext = name.rsplit('.',1)[1] | |
n = smart_str(slugify(n).replace('-', '_')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim History As New Collection | |
Private Sub Workbook_SheetActivate(ByVal Sh As Object) | |
Dim wksht As Worksheet | |
Set wksht = Sh | |
History.Add wksht | |
If History.Count > 10 Then History.Remove 1 | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript"> | |
function vimeoLoadingThumb(id){ | |
var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showThumb"; | |
var id_img = "#vimeo-" + id; | |
var script = document.createElement( 'script' ); | |
script.type = 'text/javascript'; |
NewerOlder