@@ -49,40 +49,36 @@ def get_path_for_flier(instance, filename):
49
49
50
50
class Tag (models .Model ):
51
51
"""
52
- Class used for adding classification tags on events.
52
+ Model used for adding tags on events.
53
53
"""
54
54
55
- #: The name of the tag that is displayed on the event creation form; represented
56
- #: as a CharField.
55
+ #: The name of the tag that is displayed; represented as a CharField.
57
56
display_name = models .CharField (
58
57
verbose_name = _ ('Event Tag' ),
59
- help_text = _ ('Different categories for the event.' ),
58
+ help_text = _ ('The name of the tag that will be displayed to users.' ),
59
+ unique = True ,
60
60
max_length = 256 ,
61
61
)
62
62
63
- #: Unique id of the tag; represented as an IntegerField .
64
- id = models .IntegerField (
63
+ #: Unique id of the tag; represented as an CharField .
64
+ id = models .CharField (
65
65
verbose_name = _ ('ID' ),
66
66
help_text = _ ('Unique ID of the tag.' ),
67
67
primary_key = True ,
68
+ max_length = 256 ,
68
69
)
69
70
70
- #: If the tag should be diplayed on the event creation form; represented as a
71
- #: BooleanField.
72
- display = models .BooleanField (
71
+ #: If the tag should be diplayed; represented as a BooleanField.
72
+ is_disabled = models .BooleanField (
73
73
verbose_name = _ ('Display' ),
74
- help_text = _ ('Whether or not the tag is to be displayed on the event creation form .' ),
74
+ help_text = _ ('Whether or not the tag is to be displayed.' ),
75
75
default = True ,
76
76
)
77
77
78
-
79
78
def __str__ (self ):
80
79
"""
81
- Changes what is displayed for each tag on the event creation
82
- form (without this it shows 'Tag object (id)').
83
-
84
- :return: String containing the name of the tag.
85
- :rtype: string.
80
+ :returns: Display the name of the tag.
81
+ :rtype: str
86
82
"""
87
83
return self .display_name
88
84
@@ -198,7 +194,7 @@ class Event(models.Model):
198
194
tags = models .ManyToManyField (
199
195
Tag ,
200
196
verbose_name = _ ('Event Tags' ),
201
- help_text = _ ('Different categories for classifying the event. ' ),
197
+ help_text = _ ('The name of the Tag that will be displayed to users ' ),
202
198
)
203
199
204
200
@property
@@ -207,7 +203,7 @@ def is_active(self):
207
203
Checking whether or not an event has already expired
208
204
(gone past the current date).
209
205
210
- :return : Bool value representing whether or not the event is
206
+ :returns : Bool value representing whether or not the event is
211
207
considered 'active'.
212
208
:rtype: bool
213
209
"""
@@ -218,7 +214,7 @@ def clean(self):
218
214
The clean function is used for making checks on the data posted to the
219
215
form.
220
216
221
- :return : None.
217
+ :returns : None.
222
218
:rtype: None
223
219
224
220
:raises ValidationError: if date_expire or date_hosted are invalid.
0 commit comments