sudo usermod -a -G sudo <username>
Evitando:
is not in the sudoers file. This incident will be reported.
Piedra papel tijeras lagarto spock
sudo usermod -a -G sudo <username>
is not in the sudoers file. This incident will be reported.
$ sudo apt-get install build-essential g++
$open = new OpenERP(); $p = $open->res_partner('country')->get(1); print $p->id; print $p->country->id; //many2one => res.country print $p->country('name')->name;
$fields = array('street', 'email'); $results = $open->res_partner_address($fields)->search('email', '=', 'foo@bar.com'); foreach ($results as $id => $address) { print "<h1>" . $id . "</h1>"; print "<pre>" . $address->info() . "</pre>"; print "<hr>"; }
$ sudo apt-get install python-dev build-essential libevent-1.4-2 libevent-dev $ sudo pip install django_socketio [...] Successfully installed django-socketio gevent-socketio sphinx-me gevent-websocket gevent greenlet
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', # socket 'django_socketio', )
urlpatterns += patterns('', ("", include("django_socketio.urls")), [otras urls] )
@events.on_subscribe(channel="^canal-") def menssaje(request, socket, context, channel): if not request.user.is_authenticated(): socket.send_and_broadcast_channel({'action': 'connect', 'text': 'Bienvenido Invitado'}, channel=channel) else: socket.send_and_broadcast_channel({'action': 'connect', 'text': 'Bienvenido %s' % str(request.user.username)}, channel=channel)
@events.on_message(channel="^canal-") def message(request, socket, context, message): message = message[0] action = message["action"] text = message["text"] if action == 'talk': print text socket.broadcast_channel({'action': 'talk', 'text': text}, channel)
$ ./manage.py runserver_socketio