Confused!? Yeah, me too ... Zanox' developer center is super-confusing and even finding the documentation for the correct API was tough. I had to realize that our app should access the Publisher API, which kind of makes sense but I didn't look at it first because I was thinking it's for publishing items to Zanox.
This file contains 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
function __shcmd_complete(){ | |
echo "COMPLETING WOHO!" | |
tput rc | |
tput ed | |
echo "COMPLETING WOHO!" | |
export READLINE_LINE="uh-huh" | |
} | |
function read_completion(){ | |
set -o emacs |
This file contains 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
from django import forms | |
class ConfigurableModelForm(forms.ModelForm): | |
def __init__(self, *args, **kwargs): | |
super(ConfigurableModelForm, self).__init__(*args, **kwargs) | |
opts = self.Meta | |
if hasattr(opts, 'field_conf'): | |
self.update_fields(opts.field_conf) |
This file contains 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
workon test-project | |
cdvirtualenv | |
pip install -e git+git://github.com/antonagestam/django-text.git | |
cd src | |
sudo rm -r django-text | |
ln -s ~/path/to/local/django-text/ django-text |
This file contains 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
<div class="posts"> | |
<div class="row"> | |
{% for post in posts %} | |
<div class="post">{{ post }}</div> | |
{% if not forloop.last %} | |
{% cycle '' '' '</div><div class="row">' %} | |
{% endif %} | |
{% endfor %} | |
</div> | |
</div> |
This file contains 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
from django.shortcuts import render | |
from models import User, ItemDetail | |
def my_view(request): | |
gadget_users = User.objects.filter(item_detail__category=ItemDetail.GADGET) | |
return render(request, 'yourtemplate.html', {'gadget_users': gadget_users}) |
This file contains 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
def get_category_users(category): | |
return User.objects.filter(item_detail__category=category) | |
def item_upload(request): | |
if request.method == 'POST': | |
item = ItemUpload(user=request.user) | |
form = ItemUploadForm(request.POST,request.FILES, instance=item) | |
if form.is_valid(): | |
form.save() |
This file contains 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
<h3>Gadget users</h3> | |
<ul> | |
{% for user in gadget_users %} | |
<li>{{ user }}</li> | |
{% endfor %} | |
</ul> |
This file contains 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
$ brew update | |
Already up-to-date. | |
$ brew doctor | |
Error: No such file or directory - ~/.homebrew_temp/doctor20150625-10964-1gbo4wh | |
$ brew doctor --debug | |
Error: No such file or directory - ~/.homebrew_temp/doctor20150625-10987-122pw1l | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mkdir' | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `block in mktmpdir' | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:142:in `create' | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mktmpdir' |
This file contains 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
""" | |
>>> comp("""Hi folks | |
... What is the best way to clear a Riak bucket of all key, values after | |
... running a test? | |
... I am currently using the Java HTTP API. | |
... """, """Hi folks | |
... | |
... What is the best way to clear a Riak bucket of all key, values after | |
... running a test? | |
... I am currently using the Java HTTP API. |
OlderNewer