Scripts posted recently by aitzol in Kelpi

1- 7 of 7.

Create database and grant privileges to use

to sql mysql by aitzol

create database database_name;
grant all on database_name.* to 'user_name'@'host_name' [identified by 'user_password']

Add javascrip calendar to text input

to django form javascript by aitzol

Form.base_fields['date_field_name'] = fields.DateField()
Form.base_fields['date_field_name'].widget = widgets.TextInput(attrs={'onfocus':'callToJSShowingCalendar();'})

Find POSKeyError on zope

to zodb recover poskeyerror by aitzol

from ZODB.POSException import POSKeyError
def write_log(where,what,how):
   """ """
   f = open('/tmp/%s' % where,how)
   f.write(what)

Find and delete POSKeyError on Squisdot

to squishdot ZODB recover by aitzol

sq = context.squisdot_to_recover
bad_ids = []
for i in sq.data.keys():
    p = dida.data[i]
    try:

Invoke super __init__ method

to python 2.1 by aitzol

class A():
    def __init__(self):
        ...
class B(A):
    def __init__(self):

Fitxategi bat idazteko

to python ExternalMethod by aitzol

def idatzi(non,zer,modua):
    f = open('/tmp/%s' % non,modua)
    f.write(zer)
    f.close()

Karaktere ordezkapena

to by aitzol

$_="Ordezkatu_azpimarra_zuriuneagatik";
s/_/ /g;
print "$_\n";
hits counter