Ejemplo n.º 1
0
 def create(self, user_name, email_address, display_name, password, groups):
     """docstring for create"""
     site=get_current_site()
     user = User(user_name=user_name,
                 email_address=email_address, 
                 display_name=display_name, 
                 password=password)
     site.addUser(user)
     
     for group in groups:
         Group.find_by_id(id=group, site=site).addUser(user)
     
     redirect_to_users()
Ejemplo n.º 2
0
    def create_site(self, name, title, subtitle, about_image, email, posts_per_page, url, theme, description,
                    user_name, email_address, display_name, password, groups):
        site=Sites(title=title,
                  name=name.replace(' ', '_'),
                  subtitle=subtitle,
                  about_image=about_image,
                  email=email,
                  posts_per_page=int(posts_per_page),
                  url=url,
                  theme=theme,
                  description=description)
                  
        user = User(user_name=user_name,
                    email_address=email_address, 
                    display_name=display_name, 
                    password=password)
        site.addUser(user)

        for group in groups:
            Group.find_by_id(id=group, site=site).addUser(user)


        redirect_to_site(site.name)
Ejemplo n.º 3
0
 def new(self):
     """docstring for new"""
     site=get_current_site()
     return dict(site=site,
                 archive_posts=Posts.find_archive_count(site=site),
                 archives_widget=widgets.archives_widget,
                 tags_widget=widgets.tags_widget,
                 pages_widget=widgets.pages_widget,
                 pages=Pages.find_all(site=site),
                 tags=Tags.find_all(site=site),
                 groups=Group.find_all(site=site),
                 admin_widget=widgets.admin_widget,
                 badge_widget=widgets.badge_widget,
                 recent_comments=Comments.find_recent(),
                 recent_comments_widget=widgets.recent_comments_widget)
Ejemplo n.º 4
0
 def new_site(self):
     sites = Sites.find_all()
     site = Sites.get(1)
     return dict(sites=sites,
                 groups=Group.find_all(site=site),
                 themes=Themes.find_all())