Beispiel #1
0
def init_data(app, created_models, verbosity, **kwargs):
    from sphene.community.models import Group, Navigation, CommunityUserProfileField
    if Group in created_models:
        group = Group( name = 'boostcon',
                       longname = 'Boost Conference Group',
                       baseurl = hostname(), )
        group.save()

        if Navigation in created_models:
            nav = Navigation( group = group,
                              label = 'Home',
                              href = '/wiki/show/Start/',
                              urltype = 0,
                              sortorder = 10,
                              navigationType = 0,
                              )
            nav.save()

            nav = Navigation( group = group,
                              label = 'Board',
                              href = '/board/show/0/',
                              urltype = 0,
                              sortorder = 20,
                              navigationType = 0,
                              )
            nav.save()

    if CommunityUserProfileField in created_models:
        CommunityUserProfileField( name = 'ICQ UIN',
                                   regex = '\d+',
                                   sortorder = 100, ).save()
        CommunityUserProfileField( name = 'Jabber Id',
                                   regex = '.+@.+',
                                   sortorder = 200, ).save()
        CommunityUserProfileField( name = 'Website URL',
                                   regex = 'http://.*',
                                   sortorder = 300,
                                   renderstring = '<a href="%(value)s">%(value)s</a>', ).save()
Beispiel #2
0
def return_urls(request, order):
    order_hash = cryptString(settings.SECRET_KEY, str(order.id))
    host = hostname(request)
    completion_url = 'http://%(host)s/registration-complete/%(order_hash)s' % locals()
    cancel_url = 'http://%(host)s/registration-canceled/%(order_hash)s' % locals()
    return completion_url, cancel_url
Beispiel #3
0
def checkout(price, request):
    return {
        'price': price,
        'this_url': 'http://'+hostname(request)+request.get_full_path()
        }