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
From 593ff8b6a854df5cf3695dd571592cca8e204075 Mon Sep 17 00:00:00 2001 | |
From: Nicolai Spohrer <[email protected]> | |
Date: Wed, 20 Mar 2013 15:08:00 +0100 | |
Subject: [PATCH] Fix unhandled ActivityNotFoundException if no Play Store is | |
installed on device (e.g. emulator) | |
--- | |
AppRate/src/com/tjeannin/apprate/AppRate.java | 8 ++++++-- | |
1 file changed, 6 insertions(+), 2 deletions(-) |
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
From ff4af50a4326956672989b335c21520189b6b49b Mon Sep 17 00:00:00 2001 | |
From: Nicolai Spohrer <[email protected]> | |
Date: Wed, 20 Mar 2013 15:20:31 +0100 | |
Subject: [PATCH] Fix unhandled ActivityNotFoundException if no Play Store is | |
installed on device (e.g. emulator) | |
--- | |
AppRate/src/com/tjeannin/apprate/AppRate.java | 8 ++++++-- | |
1 file changed, 6 insertions(+), 2 deletions(-) |
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
From ff4af50a4326956672989b335c21520189b6b49b Mon Sep 17 00:00:00 2001 | |
From: Nicolai Spohrer <[email protected]> | |
Date: Wed, 20 Mar 2013 15:20:31 +0100 | |
Subject: [PATCH 1/2] Fix unhandled ActivityNotFoundException if no Play Store | |
is installed on device (e.g. emulator) | |
--- | |
AppRate/src/com/tjeannin/apprate/AppRate.java | 8 ++++++-- | |
1 file changed, 6 insertions(+), 2 deletions(-) |
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 NoEditForeignTablesInlineMixin(object): | |
""" Don't show links to add/edit/delete foreign key element besides ForeignKey selection in forms """ | |
no_edit_foreign_tables_in_form = [] | |
def get_form(self, request, obj=None, **kwargs): | |
""" | |
Don't allow adding/changing/deleting users inline | |
""" | |
form = super(NoEditForeignTablesInlineMixin, self).get_form(request, obj, **kwargs) | |
for key in self.no_edit_foreign_tables_in_form: |
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
# Normal View (has a link to export view and keeps GET parameters) | |
@method_decorator(staff_member_required(login_url='user_login'), name='dispatch') | |
class PaymentListView(FilterView): | |
filterset_class = filters.PaymentFilter | |
template_name = "barsys/userarea/payment_list.html" | |
paginate_by = 10 | |
# Export View | |
@method_decorator(staff_member_required(login_url='user_login'), name='dispatch') | |
class PaymentExportView(FilterView): |
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
# A DetailView of a User can have a paginated list of Purchases | |
# In the template, the pagination needs to done similar to the following example: | |
# {% bootstrap_pagination purchases_page_obj extra=request.GET.urlencode parameter_name="purchases_page" %} | |
from django.views.generic.detail import DetailView | |
from django.core import paginator | |
@method_decorator(staff_member_required(login_url='user_login'), name='dispatch') | |
class UserDetailView(DetailView): | |
model = User |
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 ProductAutochangeInlineFormSet( | |
forms.inlineformset_factory(ProductAutochangeSet, ProductAutochange, form=ProductAutochangeForm, extra=1)): | |
def clean(self): | |
super(ProductAutochangeInlineFormSet, self).clean() | |
product_pks = [] | |
num_productautochanges = 0 | |
for form in self.forms: | |
if not form.is_valid(): | |
continue |
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
STATIC_URL = '/site1/static/' | |
# adjust name of session id | |
SESSION_COOKIE_NAME = "site1" |
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
line 1 a | |
line 2 | |
line 3 |
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
#!/bin/bash | |
for file in "$@"; do | |
echo "--- [$file]" | |
echo "- Cropping $file..." | |
pdfcrop --margin 5 $file /tmp/PDFCROP_TEMP.pdf | |
if [ $? -eq 0 ]; then | |
# success | |
echo "- Conversion successful. Replacing original file $file." | |
mv /tmp/PDFCROP_TEMP.pdf $file |