Revision 97fffe10 snf-cyclades-app/synnefo/db/models.py
b/snf-cyclades-app/synnefo/db/models.py | ||
---|---|---|
193 | 193 |
|
194 | 194 |
|
195 | 195 |
class QuotaHolderSerial(models.Model): |
196 |
"""Model representing a serial for a Quotaholder Commission. |
|
197 |
|
|
198 |
serial: The serial that Quotaholder assigned to this commission |
|
199 |
pending: Whether it has been decided to accept or reject this commission |
|
200 |
accept: If pending is False, this attribute indicates whether to accept |
|
201 |
or reject this commission |
|
202 |
resolved: Whether this commission has been accepted or rejected to |
|
203 |
Quotaholder. |
|
204 |
|
|
205 |
""" |
|
196 | 206 |
serial = models.BigIntegerField(null=False, primary_key=True, |
197 | 207 |
db_index=True) |
198 | 208 |
pending = models.BooleanField(default=True, db_index=True) |
199 |
accepted = models.BooleanField(default=False)
|
|
200 |
rejected = models.BooleanField(default=False)
|
|
209 |
accept = models.BooleanField(default=False) |
|
210 |
resolved = models.BooleanField(default=False)
|
|
201 | 211 |
|
202 | 212 |
class Meta: |
203 | 213 |
verbose_name = u'Quota Serial' |
204 | 214 |
ordering = ["serial"] |
205 | 215 |
|
206 |
def save(self, *args, **kwargs): |
|
207 |
self.pending = not (self.accepted or self.rejected) |
|
208 |
super(QuotaHolderSerial, self).save(*args, **kwargs) |
|
209 |
|
|
210 | 216 |
|
211 | 217 |
class VirtualMachine(models.Model): |
212 | 218 |
# The list of possible actions for a VM |
Also available in: Unified diff