[ add comment ] | [ 0 trackbacks ] | permalink
thanks to GLYN JACKSON
Freelance Developer
How much hard work are those standard textareas in your Django Admin? Lets change that by adding a full HTML text editor…. ckeditor, anyone?
Yeah, I know, there are a lot of packages that already do this. However, if all you require is a simple WYSIWYG editor within your admin, it's so easy and far more elegant to just add one in yourself.
In jut 3 steps:
1) Download the latest version of CKEditor.
2) Place all the CKEditor files you just downloaded into your static root so it can be served.
3) In your admin.py add something like the following...
from django.contrib import admin
from django.db import models
from django import forms
from .models import Entry
class EntryAdmin(admin.ModelAdmin):
formfield_overrides = { models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, }
list_display = ['title', 'creation_date', 'status']
class Media:
js = ('ckeditor/ckeditor.js',)
admin.site.register(Entry, EntryAdmin)
[ add comment ] | [ 0 trackbacks ] | permalink | related link
Seeed?
Seeed is a hardware innovation platform for makers to grow inspirations into differentiating products. By working closely with technology providers of all scale, Seeed provides accessible technologies with quality, speed and supply chain knowledge. When prototypes are ready to iterate, Seeed helps productize 1 to 1,000 pcs using in-house engineering, supply chain management and agile manufacture forces. Seeed also team up with incubators, China tech ecosystem, investors and distribution channels to portal Maker startups beyond.
[ add comment ] | [ 0 trackbacks ] | permalink
[ add comment ] | [ 0 trackbacks ] | permalink
[ add comment ] | [ 0 trackbacks ] | permalink
A cryptographic hash (sometimes called ‘digest’) is a kind of ‘signature’ for a text or a data file. SHA-256 generates an almost-unique 256-bit (32-byte) signature for a text.
[ add comment ] | [ 0 trackbacks ] | permalink | related link
1) connection
#!/usr/bin/python
import psycopg2
import sys
try:
conn = psycopg2.connect('host=*** dbname=*** user=*** password=***')
print "Connected to Database"
except:
print "No Connection"
http://initd.org/psycopg/docs/usage.html
2) get_or_create
def get_or_create(session, model, **kwargs):
instance = session.query(model).filter_by(**kwargs).first()
if instance:
return instance
else:
instance = model(**kwargs)
session.add(instance)
return instance
http://stackoverflow.com/questions/6587 ... d-simultan
http://techspot.zzzeek.org/2008/09/09/s ... -booleans/
[ add comment ] | [ 0 trackbacks ] | permalink | related link
http://www.plixer.com/blog/netflow-and- ... eshooting/
http://www.lovemytool.com/blog/2010/02/ ... erson.html
http://yurisk.info/2011/03/28/how-to-se ... flow-tool/
http://yurisk.info/Nfsen_custom_profile2.png
[ add comment ] | [ 0 trackbacks ] | permalink
visual sedimentation
http://hal.inria.fr/docs/00/84/62/60/PD ... ready3.pdf
Sankey Diagrams
http://bost.ocks.org/mike/sankey/
http://bl.ocks.org/syntagmatic
[ add comment ] | [ 0 trackbacks ] | permalink | related link
100% native and cool looking animated JavaScript/CoffeeScript
gaugecoffee
[ add comment ] ( 2 views ) | [ 0 trackbacks ] | permalink | related link