Skip to content

Conversation

@j4mie
Copy link
Member

@j4mie j4mie commented May 13, 2015

No description provided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone can think of a better way of doing this, please let me know. With Django's built-in UUIDField, self.pk is already a UUID at this point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the model has a state field: perhaps checking self.state == STATES.NEW?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried that. The tests fail. They fail because when the worker is running in a real app, the state is prodded externally by the worker process as the jobs are processed. In the tests, this prodding wasn't happening. I could do the prodding in the tests, but it feels a bit fragile..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then perhaps this initialisation step should be in a model classmethod or manager method for creating the job?

@weargoggles
Copy link
Contributor

Since my problem with this is not a functional change, 🌠

j4mie added a commit that referenced this pull request May 14, 2015
@j4mie j4mie merged commit 2345cae into master May 14, 2015
@j4mie j4mie deleted the python-3 branch May 14, 2015 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants