How to use the publish.models.FlatPage.objects.create function in publish

To help you get started, we’ve selected a few publish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TestDeleteSelected, self).setUp()
            self.fp1 = FlatPage.objects.create(url='/fp1', title='FP1')
            self.fp2 = FlatPage.objects.create(url='/fp2', title='FP2')
            self.fp3 = FlatPage.objects.create(url='/fp3', title='FP3')
            
            self.fp1.publish()
            self.fp2.publish()
            self.fp3.publish()
            
            self.admin_site = AdminSite('Test Admin')
            self.page_admin = PublishableAdmin(FlatPage, self.admin_site)
            
            # override urls, so reverse works
            settings.ROOT_URLCONF=patterns('',
                ('^admin/', include(self.admin_site.urls)),
            )
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TransactionTestCase, self).setUp()
            self.flat_page1 = FlatPage.objects.create(url='/url1/', title='title 1')
            self.flat_page2 = FlatPage.objects.create(url='/url2/', title='title 2')
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TransactionTestCase, self).setUp()
            self.flat_page1 = FlatPage.objects.create(url='/url1/', title='title 1')
            self.flat_page2 = FlatPage.objects.create(url='/url2/', title='title 2')
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TestUndeleteSelected, self).setUp()
            self.fp1 = FlatPage.objects.create(url='/fp1', title='FP1')
            
            self.fp1.publish()

            self.admin_site = AdminSite('Test Admin')
            self.page_admin = PublishableAdmin(FlatPage, self.admin_site)
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TestDeleteSelected, self).setUp()
            self.fp1 = FlatPage.objects.create(url='/fp1', title='FP1')
            self.fp2 = FlatPage.objects.create(url='/fp2', title='FP2')
            self.fp3 = FlatPage.objects.create(url='/fp3', title='FP3')
            
            self.fp1.publish()
            self.fp2.publish()
            self.fp3.publish()
            
            self.admin_site = AdminSite('Test Admin')
            self.page_admin = PublishableAdmin(FlatPage, self.admin_site)
            
            # override urls, so reverse works
            settings.ROOT_URLCONF=patterns('',
                ('^admin/', include(self.admin_site.urls)),
            )
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TestDeleteSelected, self).setUp()
            self.fp1 = FlatPage.objects.create(url='/fp1', title='FP1')
            self.fp2 = FlatPage.objects.create(url='/fp2', title='FP2')
            self.fp3 = FlatPage.objects.create(url='/fp3', title='FP3')
            
            self.fp1.publish()
            self.fp2.publish()
            self.fp3.publish()
            
            self.admin_site = AdminSite('Test Admin')
            self.page_admin = PublishableAdmin(FlatPage, self.admin_site)
            
            # override urls, so reverse works
            settings.ROOT_URLCONF=patterns('',
                ('^admin/', include(self.admin_site.urls)),
            )
github johnsensible / django-publish / publish / tests.py View on Github external
def setUp(self):
            super(TestPublishableManyToMany, self).setUp()
            self.flat_page = FlatPage.objects.create(
                                      url='/my-page', title='my page',
                                      content='here is some content', 
                                      enable_comments=False,
                                      registration_required=True)
            self.site1 = Site.objects.create(title='my site', domain='mysite.com')
            self.site2 = Site.objects.create(title='a site', domain='asite.com')