~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/featured.py

  • Committer: Benji York
  • Date: 2013-11-18 20:38:47 UTC
  • mto: This revision was merged to the branch mainline in revision 465.
  • Revision ID: benji@benjiyork.com-20131118203847-2mfs1w7b8aqy64mr
checkpoint

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012-2014 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2012, 2013 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
from deform import (
8
8
from pyramid.httpexceptions import HTTPFound
9
9
from pyramid.view import view_config
10
10
 
11
 
from charmworld.forms.featured import get_schema
12
 
from charmworld.models import (
13
 
    FeaturedSource,
14
 
)
 
11
from charmworld.forms.featured import CharmFeaturedness
 
12
from charmworld.models import FeaturedSource
15
13
from charmworld.views.helpers import (
16
14
    find_charm,
17
15
    find_bundle,
21
19
 
22
20
def featured_edit(request, item, kind, url):
23
21
    """Back end for featuring an "item" which can be a charm or bundle."""
24
 
    form = Form(get_schema(kind), buttons=('submit',))
 
22
    form = Form(CharmFeaturedness(), buttons=('submit',))
25
23
    form.css_class = 'form-horizontal well'
26
24
    featured_source = FeaturedSource.from_db(request.db)
27
25