Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-newsbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WebU
shared
django-newsbox
Commits
fa4e57c8
Commit
fa4e57c8
authored
9 years ago
by
Olivier Le Brouster
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove useless (and bad) imports
parent
ff63e4e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
newsbox_cms/cms_plugins.py
+3
-6
3 additions, 6 deletions
newsbox_cms/cms_plugins.py
with
3 additions
and
6 deletions
newsbox_cms/cms_plugins.py
+
3
−
6
View file @
fa4e57c8
...
...
@@ -2,8 +2,6 @@
from
__future__
import
unicode_literals
from
django.utils.translation
import
ugettext
as
_
from
django.db
import
models
from
django.contrib
import
admin
from
cms.plugin_base
import
CMSPluginBase
from
newsbox.models
import
NewsboxBase
...
...
@@ -17,7 +15,6 @@ class NewsboxPluginBase(CMSPluginBase):
return
NewsboxModel
.
objects
.
published
()
def
render
(
self
,
context
,
instance
,
placeholder
):
from
django.db.models.loading
import
get_model
NewsboxModel
=
instance
.
newsbox_model
...
...
@@ -25,7 +22,7 @@ class NewsboxPluginBase(CMSPluginBase):
raise
Exception
(
_
(
"
The choosen news type to display is invalid
"
))
newsset
=
self
.
get_instance_queryset
(
instance
=
instance
,
instance
=
instance
,
request
=
context
[
'
request
'
])
if
instance
.
numitems
>
0
:
...
...
@@ -56,13 +53,13 @@ class NewsboxPluginBase(CMSPluginBase):
'
newsbox_opts
'
:
NewsboxModel
.
_newsbox_meta
,
'
with_pager
'
:
with_pager
,
})
if
instance
.
page_link
:
context
.
update
({
'
title_url
'
:
instance
.
page_link
.
get_absolute_url
(),
'
all_news_url
'
:
instance
.
page_link
.
get_absolute_url
(),
})
return
context
class
Meta
:
abstract
=
True
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment