Hallo,
I have a model in which I have defined a "unique_togther" of two
fields in Meta class section:
from django.db import models
from production.processors.models import Processor
class Processoroutput(models.Model):
processorID = models.IntegerField(primary_key=True,
choices=[(p.processorID,'%s'%
p.processorID)
for p in
Processor.objects.all()])
datasetID = models.IntegerField(primary_key=True)
fileMatchRegExp = models.CharField(maxlength=240)
triggerEvent = models.SmallIntegerField(null=True)
mandatory = models.SmallIntegerField(null=True)
cass Admin:
list_display = ('processorID', 'datasetID','fileMatchRegExp',
'triggerEvent')
list_filter = ('fileMatchRegExp',)
search_fields = ('processorID', 'fileMatchRegExp',
'triggerEvent')
class Meta:
db_table = 'processorOutput'
unique_together = (("processorID", "datasetID"),)
The produced table in MySQL looks like the following, if I use the
command: "python manage.py sqlall processorOutputs"
BEGIN;
CREATE TABLE `processorOutput` (
`processorID` integer NOT NULL PRIMARY KEY,
`datasetID` integer NOT NULL PRIMARY KEY,
`fileMatchRegExp` varchar(240) NOT NULL,
`triggerEvent` smallint NULL,
`mandatory` smallint NULL,
UNIQUE (`processorID`, `datasetID`)
);
COMMIT;
Then if I want to change the value of table's fields in "Admin
Interface", it doesn't change the value of fields!
Every suggestion will be appreciated.
Regards,
Nader
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---