This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "fail.py", line 10, in <module> | |
m_fail = MultipartEncoderMonitor.from_fields(fields=fields_fail) | |
File "/opt/active_version/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 297, in from_fields | |
encoder = MultipartEncoder(fields, boundary, encoding) | |
File "/opt/active_version/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 89, in __init__ | |
self._prepare_parts() | |
File "/opt/active_version/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 171, in _prepare_parts | |
self.parts = [Part.from_field(f, enc) for f in fields] | |
File "/opt/active_version/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 383, in from_field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo(Model): | |
bars = ManyToManyField(Bar, related_name='foos', blank=True, null=True) | |
class Bar(Model): | |
name = CharField(unique=True) | |
# The process I know currently: | |
foo = Foo() | |
foo.save() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## customauth/admin.py | |
from django.contrib import admin | |
from customauth.models import MyUser | |
admin.site.register(MyUser) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this does not work | |
Foo.controllers :bar do | |
get :auth, :map => '/auth/:provider/callback' do | |
#... | |
end | |
end | |
#this works |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './rack_auth_digest' | |
run Protected.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURLM *curl; | |
static void foo_cb(const char *data, const char *moredata) { | |
struct curl_httppost *post = NULL; | |
struct curl_httppost *last = NULL; | |
CURL *handle; | |
handle = curl_easy_init(); | |
curl_formadd(&post, &last, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data_mapper (1.0.2) | |
data_objects (0.10.2) | |
datamapper (1.0.2) | |
dm-aggregates (1.0.2) | |
dm-constraints (1.0.2) | |
dm-core (1.0.2) | |
dm-do-adapter (1.0.2) | |
dm-migrations (1.0.2) | |
dm-serializer (1.0.2) | |
dm-sqlite-adapter (1.0.2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ubuntu 10.04 | |
Kernel Linux 2.6.32-21-generic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FileQueue | |
def initialize(file_name) | |
@file_name = file_name | |
end | |
def push(obj) | |
safe_open('a') do |file| | |
file.write(obj + "\n") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
get '/foo' do | |
"Hello from Foo" | |
end | |
end | |
class Bar < Sinatra::Base | |
include Foo | |
get '/' do |
NewerOlder