$('div.info').holedDiv({
'padding': 10,
'radius': 10, //0 if you don't want rounded borders
'stroke': false, //if you want to add a (black) stroke to the background
'holeRadius': 20,
'drawInner': true, //if you want to draw an inner circle, like the demo
'drawInnerColor': 'black' //the color of the inner circle
});
Tested On:
Chrome 10
Firefox 4b10
Opera 10
IE 9
If you find any bug, or have any question (or feature suggestions) please let me know
Update 03/02/2011 20.41
Added version 0.1.1 that supports IE 9.0
Update 04/02/2011 23.50
Version 0.2 is ready, supports IE < 9 using excanvas
This is my last project, an intervalometer for my Canon EOS 400d created with arduino.
I created it because i need to create some time lapse video for the coming soon bisaccia.info‘s web tv.
Here are two videos:
The “Backstage”:
A sample time lapse:
I’ll upload the code and the schematic soon when I create a better version, currently you can’t change the delay between every shoots, also you can’t stop it.
A better time lapse video is also coming but I should buy a battery grip for my canon, currently my battery last only 5 hours.
In a recent project I needed to save a file to a dynamic directory.
My model was something like this:
from django.dbimport models
class MyDoc(models.Model):
name = models.CharField()
document = models.FileField(upload_to='uploads/documents')
with this code each document will be uploaded to MEDIA_ROOT/uploads/documents.
In order to upload the file to a dynamic dir like this: MEDIA_ROOT/uploads/documents/id/ I used this code:
from django.dbimport models
class MyDoc(models.Model):
upload_to = 'uploads/documents/%d/%s'def _get_upload_to(self, filename):
returnself.upload_to%(self.pk, filename)
name = models.CharField()
document = models.FileField(upload_to=_get_upload_to)
That’s all (Thats’s Django!), now this code will upload each document into a separated dir for each object.
UPDATE
The code I posted before doesn’t work properly in fact the first time we save the model the pk is None so this code can’t get the correct path.
If you have any question, please feel free to ask.
Today I wanna show you a simple way to add an additional view to the admin site.
Imagine that you want to create a view to review a model, something like send an email to the site owner with your thoughs (or your changes) about an entry.
First we need to define a simple model (of course you can use your existing model):
from django.dbimport models
class MyEntry(models.Model):
title = models.CharField(max_length=100)
body = models.TextField()def__unicode__(self):
returnself.titleclass Meta(object):
verbose_name = 'My Entry'
verbose_name_plural = 'My Entries'