Skip to content

Instantly share code, notes, and snippets.

@miloshadzic
miloshadzic / admin.py
Created December 11, 2010 12:09
CategoryAdmin
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name']
list_display_links = []
list_editable = ['name']
# I want to have a list of Categories that can be edited on the listing. I'm getting this error:
Environment:
Request Method: GET
class Book(models.Model):
isbn = models.IntegerField(max_length=13)
title = models.CharField(max_length=100)
pub_date = models.IntegerField(max_length=4, choices=YEARS)
authors = models.ManyToManyField(Author, related_name="books")
categories = models.ManyToManyField(Category)
def __unicode__(self):
return self.title
sudo add-apt-repository ppa:elementaryart/ppa
sudo add-apt-repository ppa:tiheum/equinox
sudo apt-get update && sudo apt-get install elementary-theme elementary-icon-theme faenza-icon-theme
$ bin/rbx console
Please select which agent:
1: 16924 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
2: 22284 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
3: 3775 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
4: 9576 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
5: 28082 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
6: 803 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
7: 26396 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
8: 15948 - bin/rbx -Xagent.start -v /home/milos/Devel/Ruby/rubinius/mspec/bin/mspec-ci --background
TCPSocket.new
- requires a hostname and a port as arguments
- refuses the connection when there is no server to connect to (FAILED - 1)
- connects to a listening server
rubinius 1.2.1dev (1.8.7 df519b98 2010-12-21 JI) [i686-pc-linux-gnu]
.F
rubinius 1.2.1dev (1.8.7 df519b98 2010-12-21 JI) [i686-pc-linux-gnu]
TCPSocket.new
- requires a hostname and a port as arguments
- refuses the connection when there is no server to connect to (FAILED - 1)
- connects to a listening server
rubinius 1.2.1dev (1.8.7 df519b98 2010-12-21 JI) [i686-pc-linux-gnu]
F
1)
TCPSocket.new refuses the connection when there is no server to connect to FAILED
Expected Errno::ECONNREFUSED
but got Errno::EHOSTUNREACH (No route to host - connect(2))
/expectations.rb:15
{ } in main.__script__ at spec/ruby/library/socket/tcpsocket/shared
/new.rb:15
$ bin/rbx -e 'p Socket.getaddrinfo("127.0.0.1", nil)[0][2]'
An exception occurred evaluating command line code
Missing or uninitialized constant: Object::Socket (NameError)
Backtrace:
Module(Class)#const_missing at kernel/common/module.rb:533
{ } in Object#__script__ at -e:1
Kernel(Rubinius::Loader)#eval at kernel/common/eval.rb:115
Rubinius::Loader#evals at kernel/loader.rb:517
Rubinius::Loader#main at kernel/loader.rb:649
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 1725/mono
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1232/cupsd
tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 1698/dropbox
tcp6 0 0 ::1:631 :::* LISTEN 1232/cupsd