jeexianwu / goflow

Automatically exported from code.google.com/p/goflow
Other
0 stars 0 forks source link

queryset bug #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

 the bug queryset yet appears in goflow-0.65.

in sqlite database :
sqlite> select * from runtime_workitem;
1|2008-09-25 13:45:31.875000|1|7|1||0|0|complete
2|2008-09-25 13:45:46.187000|1|8|3|1|0|0|active
3|2008-09-25 14:49:12|1|9|54|2|0|0|complete
4|2008-09-26 09:05:54.765000|1|9|34|3|0|0|active
5|2008-09-29 10:32:26.953000|1|10|1||0|0|complete
6|2008-09-29 10:32:57|1|11|3|5|0|0|active
7|2008-09-29 11:48:14.828000|1|12|54|6|0|0|complete
8|2008-09-29 11:48:14.953000||12|34|7|0|0|inactive
9|2008-09-29 13:32:28.296000|1|13|1||0|0|complete
10|2008-09-29 13:32:37.250000|1|14|3|9|0|0|active
11|2008-09-29 13:32:39.015000|1|15|54|10|0|0|active
12|2008-09-29 16:02:26.078000|1|16|1||0|0|complete
13|2008-09-29 16:02:32.343000|1|17|3|12|0|0|active
14|2008-09-29 16:39:07.750000|1|18|54|13|0|0|active
sqlite>

in the program :
    queryset_vco = WorkItem.objects.filter(activity__title=u'Valid')
    if queryset_vco:
        WorkItemsi_vco = WorkItem.objects.list_safe(user=request.user,
queryset=queryset_vco, status='inactive', notstatus='', noauto=True)

in the result :
id      Status  Action
8       inactive        activate
8       inactive        activate

regards,
Geronimo 

Original issue reported on code.google.com by esimo...@gmail.com on 30 Sep 2008 at 1:08

GoogleCodeExporter commented 9 years ago
what is the fix for this problem ?? Im too facing the problem for mysql

Original comment by saurav....@gmail.com on 25 Aug 2009 at 12:25

GoogleCodeExporter commented 9 years ago
This is my error log when i try to run python manange.py syncdb --noinput

D:\work\sigma\leavedemo>python manage.py syncdb --noinput
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table workflow_activity
Creating table workflow_process
Creating table workflow_application
Creating table workflow_pushapplication
Creating table workflow_transition
Creating table workflow_userprofile
Creating table graphics2_processimage
Creating table graphics2_activityposition
Creating table runtime_processinstance
Creating table runtime_workitem
Creating table runtime_event
Creating table apptools_defaultappmodel
Creating table apptools_image
Creating table apptools_icon
Creating table apptools_imagebutton
Creating table leave_leaverequest
Creating table leave_manager
Creating table leave_account
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for admin.LogEntry model
Installing index for workflow.Activity model
Installing index for workflow.Process model
Installing index for workflow.Transition model
Installing index for graphics2.ProcessImage model
Installing index for graphics2.ActivityPosition model
Installing index for runtime.ProcessInstance model
Installing index for runtime.WorkItem model
Installing index for runtime.Event model
Installing index for apptools.ImageButton model
Installing index for leave.LeaveRequest model
Installing index for leave.Manager model
Installing index for leave.Account model
Installing json fixture 'initial_data' from 'C:\Python25\lib\site-packages\goflo
w\workflow\fixtures'.
Installing json fixture 'initial_data' from 'C:\Python25\lib\site-packages\goflo
w\apptools\fixtures'.
Installing json fixture 'initial_data' from 'D:\work\sigma\leavedemo\..\leavedem
o\leave\fixtures'.
Problem installing fixture 'D:\work\sigma\leavedemo\..\leavedemo\leave\fixtures\
initial_data.json': Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\django\core\management\commands\loaddata.p
y", line 153, in handle
    obj.save()
  File "C:\Python25\Lib\site-packages\django\core\serializers\base.py", line 163
, in save
    models.Model.save_base(self.object, raw=True)
  File "C:\Python25\Lib\site-packages\django\db\models\base.py", line 495, in sa
ve_base
    result = manager._insert(values, return_id=update_pk)
  File "C:\Python25\Lib\site-packages\django\db\models\manager.py", line 177, in
 _insert
    return insert_query(self.model, values, **kwargs)
  File "C:\Python25\Lib\site-packages\django\db\models\query.py", line 1087, in
insert_query
    return query.execute_sql(return_id)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\subqueries.py", line
320, in execute_sql
    cursor = super(InsertQuery, self).execute_sql(None)
  File "C:\Python25\Lib\site-packages\django\db\models\sql\query.py", line 2369,
 in execute_sql
    cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\util.py", line 19, in e
xecute
    return self.cursor.execute(sql, params)
  File "C:\Python25\Lib\site-packages\django\db\backends\mysql\base.py", line 84
, in execute
    return self.cursor.execute(query, args)
  File "C:\Python25\Lib\site-packages\MySQLdb\cursors.py", line 166, in execute
    self.errorhandler(self, exc, value)
  File "C:\Python25\Lib\site-packages\MySQLdb\connections.py", line 35, in defau
lterrorhandler
    raise errorclass, errorvalue
IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constrai
nt fails (`leavedemo`.`workflow_activity`, CONSTRAINT `process_id_refs_id_2a8fbd
c0` FOREIGN KEY (`process_id`) REFERENCES `workflow_process` (`id`))')

Original comment by saurav....@gmail.com on 26 Aug 2009 at 4:39