Commit eee1540e34c1985b1f6cedd1ec91c1cdb4bcbc4a

Authored by Zambom
1 parent 4c87a11b

Adjusts in subjects form

subjects/forms.py
... ... @@ -9,6 +9,8 @@ class CreateSubjectForm(forms.ModelForm):
9 9 'students', )
10 10  
11 11 widgets = {
  12 + 'description_brief': forms.Textarea,
  13 + 'description': forms.Textarea,
12 14 'professor': forms.SelectMultiple,
13 15 'students': forms.SelectMultiple,
14 16 }
... ...
subjects/migrations/0008_auto_20170103_2044.py 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +# -*- coding: utf-8 -*-
  2 +# Generated by Django 1.10 on 2017-01-03 23:44
  3 +from __future__ import unicode_literals
  4 +
  5 +from django.db import migrations, models
  6 +
  7 +
  8 +class Migration(migrations.Migration):
  9 +
  10 + dependencies = [
  11 + ('subjects', '0007_auto_20170103_1539'),
  12 + ]
  13 +
  14 + operations = [
  15 + migrations.AlterField(
  16 + model_name='subject',
  17 + name='description',
  18 + field=models.TextField(blank=True, verbose_name='description'),
  19 + ),
  20 + migrations.AlterField(
  21 + model_name='subject',
  22 + name='description_brief',
  23 + field=models.TextField(blank=True, verbose_name='simpler_description'),
  24 + ),
  25 + ]
... ...
subjects/models.py
... ... @@ -18,8 +18,8 @@ class Subject(models.Model):
18 18 name = models.CharField( _("Name"), unique = True,max_length= 200)
19 19 slug = AutoSlugField(_("Slug"),populate_from='name',unique=True)
20 20  
21   - description_brief = models.CharField(_("simpler_description"), max_length= 100, blank=True)
22   - description = models.CharField(_("description"), max_length = 300, blank= True)
  21 + description_brief = models.TextField(_("simpler_description"), blank=True)
  22 + description = models.TextField(_("description"), blank= True)
23 23 visible = models.BooleanField(_("visible"))
24 24  
25 25 init_date = models.DateField(_('Begin of Subject Date'))
... ...
subjects/templates/subjects/create.html
... ... @@ -71,7 +71,7 @@
71 71 {% render_field field %} {{field.label}}
72 72 </label>
73 73 </div>
74   - {% elif field.auto_id == 'id_description' %}
  74 + {% elif field.auto_id == 'id_description' or field.auto_id == 'id_description_brief' %}
75 75 {% render_field field class='form-control text_wysiwyg' %}
76 76 {% else %}
77 77 {% render_field field class='form-control' %}
... ...