def get_testgroup():
    try:
        return Group.objects.get( name = 'testgroup' )
    except Group.DoesNotExist:
        g = Group( name = 'testgroup',
                   longname = "Some Test Group",
                   baseurl = 'testgroup.sphene.net' )
        g.save()
        
        return g
Exemplo n.º 2
0
def get_testgroup():
    try:
        return Group.objects.get(name='testgroup')
    except Group.DoesNotExist:
        g = Group(name='testgroup',
                  longname="Some Test Group",
                  baseurl='testgroup.sphene.net')
        g.save()

        return g
Exemplo n.º 3
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='DishNine',
            longname='DishNine Group',
            baseurl='www.dishnine.com',
        )
        group.save()

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

            nav = Navigation(
                group=group,
                label='Community',
                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()
Exemplo n.º 4
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 = 'DishNine',
                       longname = 'DishNine Group',
                       baseurl = 'www.dishnine.com', )
        group.save()

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

            nav = Navigation( group = group,
                              label = 'Community',
                              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()