本文整理匯總了Python中rogerthat.models.App.name方法的典型用法代碼示例。如果您正苦於以下問題:Python App.name方法的具體用法?Python App.name怎麽用?Python App.name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rogerthat.models.App
的用法示例。
在下文中一共展示了App.name方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get
# 需要導入模塊: from rogerthat.models import App [as 別名]
# 或者: from rogerthat.models.App import name [as 別名]
def get(self):
url_app_id = self.request.get('id')
if url_app_id:
app = get_app_by_id(url_app_id)
if app:
self.write_app_details(app)
return
url_new_app = self.request.get('new_app')
if url_new_app:
self.write_app_details(None)
return
rogerthat_app = get_app_by_id(App.APP_ID_ROGERTHAT)
if rogerthat_app is None:
rogerthat_app = App(key=App.create_key(App.APP_ID_ROGERTHAT))
rogerthat_app.name = "Rogerthat"
rogerthat_app.type = App.APP_TYPE_ROGERTHAT
rogerthat_app.creation_time = now()
rogerthat_app.visible = False
rogerthat_app.put()
template = JINJA_ENVIRONMENT.get_template('apps.html')
context = self.get_request_params()
context['apps'] = sorted(get_visible_apps(), key=lambda app: (app.is_default, app.name))
self.response.out.write(template.render(context))
示例2: setUp
# 需要導入模塊: from rogerthat.models import App [as 別名]
# 或者: from rogerthat.models.App import name [as 別名]
def setUp(self, datastore_hr_probability=0):
from rogerthat.bizz.profile import create_user_profile
from rogerthat.settings import get_server_settings
from rogerthat.rpc import users
from google.appengine.datastore import datastore_stub_util
from google.appengine.ext import testbed
from rogerthat_tests import register_tst_mobile
from rogerthat.to.payment import PaymentProviderTO
from rogerthat.bizz.payment import create_payment_provider
os.environ['HTTP_HOST'] = 'rt.dev:8080'
self.testbed = testbed.Testbed()
self.testbed.activate()
self.datastore_hr_policy = datastore_stub_util.PseudoRandomHRConsistencyPolicy(
probability=datastore_hr_probability)
self.testbed.init_datastore_v3_stub(consistency_policy=self.datastore_hr_policy)
self.testbed.init_taskqueue_stub(root_path=os.path.join(os.path.dirname(__file__), '..', 'src'))
self.task_queue_stub = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
self.testbed.init_channel_stub()
self.testbed.init_search_stub()
self.testbed.init_blobstore_stub()
ss = get_server_settings()
ss.baseUrl = "http://localhost:8080" # not used
ss.mobidickAddress = "http://1.2.3.4:8090" # not used
ss.jabberEndPoints = ["jabber.example.com:8084"] # Development jabber server
ss.jabberSecret = "leeg"
ss.userCodeCipher = u"dGVzdCAlcyB0ZXN0"
ss.dashboardEmail = u"[email protected]"
ss.supportEmail = u"[email protected]"
ss.supportWorkers = ["[email protected]"]
ss.serviceCreators = ["djmatic", "[email protected]", "", "[email protected]"]
ss.staticPinCodes = ["0666", "[email protected]"]
ss.userEncryptCipherPart1 = base64.b64encode(u'userEncryptCipherPart1')
ss.userEncryptCipherPart2 = base64.b64encode(u'userEncryptCipherPart2')
rogerthat_app = App(key=App.create_key(u"rogerthat"))
rogerthat_app.name = u"Rogerthat"
rogerthat_app.type = App.APP_TYPE_ROGERTHAT
rogerthat_app.core_branding_hash = None
rogerthat_app.facebook_app_id = 188033791211994
rogerthat_app.ios_app_id = u"id446796149"
rogerthat_app.android_app_id = u"com.mobicage.rogerth.at"
rogerthat_app.secure = True
rogerthat_app.is_default = True
rogerthat_app.visible = True
rogerthat_app.creation_time = now()
rogerthat_app.admin_services = [u'[email protected]']
rogerthat_app.mdp_client_id = str(uuid.uuid4())
rogerthat_app.mdp_client_secret = str(uuid.uuid4())
be_loc_app = App(key=App.create_key(u"be-loc"))
be_loc_app.name = u"Lochristi"
be_loc_app.type = App.APP_TYPE_CITY_APP
be_loc_app.core_branding_hash = None
be_loc_app.facebook_app_id = 188033791211994
be_loc_app.ios_app_id = u"com.mobicage.cityapp.lochristi"
be_loc_app.android_app_id = u"com.mobicage.cityapp.lochristi"
be_loc_app.creation_time = now()
be_loc_app.secure = False
be_loc_app.is_default = False
be_loc_app.visible = True
be_loc_app.mdp_client_id = str(uuid.uuid4())
be_loc_app.mdp_client_secret = str(uuid.uuid4())
be_berlare_app = App(key=App.create_key(u"be-berlare"))
be_berlare_app.name = u"Berlare"
be_berlare_app.type = App.APP_TYPE_CITY_APP
be_berlare_app.core_branding_hash = None
be_berlare_app.facebook_app_id = None
be_berlare_app.ios_app_id = u"com.mobicage.cityapp.berlare"
be_berlare_app.android_app_id = u"com.mobicage.cityapp.berlare"
be_berlare_app.creation_time = now()
be_berlare_app.secure = False
be_berlare_app.is_default = False
be_berlare_app.visible = True
be_berlare_app.mdp_client_id = str(uuid.uuid4())
be_berlare_app.mdp_client_secret = str(uuid.uuid4())
osa_loyalty_app = App(key=App.create_key(u"osa-loyalty"))
osa_loyalty_app.name = u"OSA Loyalty"
osa_loyalty_app.type = App.APP_TYPE_CONTENT_BRANDING
osa_loyalty_app.core_branding_hash = None
osa_loyalty_app.facebook_app_id = 188033791211994
osa_loyalty_app.ios_app_id = u"com.mobicage.rogerthat.osa.loyalty"
osa_loyalty_app.android_app_id = u"com.mobicage.rogerthat.osa.loyalty"
osa_loyalty_app.creation_time = now()
osa_loyalty_app.is_default = False
osa_loyalty_app.visible = True
put_and_invalidate_cache(ss, rogerthat_app, be_loc_app, be_berlare_app, osa_loyalty_app)
create_payment_provider(PaymentProviderTO(id=u"payconiq",
name=u"Payconiq",
logo=None,
version=1,
description=u"payconiq descripion is markdown",
oauth_settings=None,
background_color=None,
#.........這裏部分代碼省略.........
示例3: post
# 需要導入模塊: from rogerthat.models import App [as 別名]
# 或者: from rogerthat.models.App import name [as 別名]
def post(self):
success = False
app_id = self.request.POST.get("app_id", None)
name = self.request.POST.get("name", None)
app_type = self.request.POST.get("app_type", None)
fb_app_id = self.request.POST.get("fb_app_id", None)
ios_app_id = self.request.POST.get("ios_app_id", None)
android_app_id = self.request.POST.get("android_app_id", None)
dashboard_email_address = self.request.POST.get('dashboard_email_address', None)
contact_email_address = self.request.POST.get("contact_email_address", None)
user_regex = self.request.POST.get("user_regex", None)
qr_templates_count = int(self.request.POST.get("qr_templates_count", 0))
default_qr_template_index = int(self.request.POST.get("default_qr_template_index", 0))
auto_connected_services_string = self.request.POST.get("auto_connected_services", "[]")
logging.debug("auto_connected_services = %s", auto_connected_services_string)
beacon_major_str = self.request.POST.get("beacon_major", 0)
beacon_major = int(beacon_major_str) if beacon_major_str else 0
demo = bool(self.request.POST.get("demo", ''))
beta = bool(self.request.POST.get("beta", ''))
mdp_client_id = self.request.POST.get('mdp_client_id', None)
mdp_client_secret = self.request.POST.get('mdp_client_secret', None)
orderable_apps = self.request.get_all('orderable_apps')
auto_connected_services = parse_complex_value(AutoConnectedService,
json.loads(auto_connected_services_string),
True)
admin_services = json.loads(self.request.POST.get('admin_services', '[]'))
beacon_regions = json.loads(self.request.POST.get("beacon_regions", "[]"))
try:
app_type = None if not app_type else int(app_type)
except Exception:
app_type = None
try:
fb_app_id = None if not fb_app_id else int(fb_app_id)
except Exception:
fb_app_id = None
if not app_id:
result = "Failed to create new app (app_id was empty)!"
elif [c for c in app_id if c not in '-abcdefghijklmnopqrstuvwxyz0123456789']:
result = "App ids should only contain (-, lower case alphabet characters and numbers)"
elif not name:
result = "Failed to create new app (name was empty)!"
elif app_type is None:
result = "Failed to create new app (app_type was empty)!"
elif not ios_app_id:
result = "Failed to create new app (ios_app_id was empty)!"
elif not android_app_id:
result = "Failed to create new app (android_app_id was empty)!"
elif not dashboard_email_address:
result = "Failed to create new app (dashboard_email_address was empty)!"
else:
try:
if user_regex:
validate_user_regex(user_regex)
zip_stream = self.request.POST.get('core_branding').file
zip_stream.seek(0)
try:
zip_ = ZipFile(zip_stream)
except BadZipfile, e:
raise BrandingValidationException(e.message)
branding = store_branding_zip(None, zip_, u"Core branding of %s" % app_id)
app = App(key=App.create_key(app_id))
to_be_put = []
app.qrtemplate_keys = []
for i in xrange(qr_templates_count):
file_ = self.request.POST.get('qr_template_%s' % i)
description = self.request.POST.get("qr_template_description_%s" % i)
color = self.request.POST.get("qr_template_color_%s" % i)
file_ = file_.file.getvalue() if isinstance(file_, FieldStorage) else None
key_name = create_qr_template_key_name(app_id, description)
store_template(None, file_, description, color, key_name)
if default_qr_template_index == i:
app.qrtemplate_keys.insert(0, key_name)
else:
app.qrtemplate_keys.append(key_name)
app.name = name
app.type = app_type
app.core_branding_hash = branding.hash
app.facebook_app_id = fb_app_id
app.ios_app_id = ios_app_id
app.android_app_id = android_app_id
app.dashboard_email_address = dashboard_email_address
app.contact_email_address = contact_email_address
app.user_regex = user_regex
app.creation_time = now()
app.is_default = get_default_app_key() is None
app.demo = demo
app.beta = beta
app.mdp_client_id = mdp_client_id or None
app.mdp_client_secret = mdp_client_secret or None
app.auto_connected_services = AutoConnectedServices()
for acs in auto_connected_services:
service_identity_user = add_slash_default(users.User(acs.service_identity_email))
#.........這裏部分代碼省略.........