Skip to content

Convert initial value that comes as int to a list of flag names.#32

Open
zaxl wants to merge 4 commits into
disqus:masterfrom
zaxl:fix_initial_in_admin
Open

Convert initial value that comes as int to a list of flag names.#32
zaxl wants to merge 4 commits into
disqus:masterfrom
zaxl:fix_initial_in_admin

Conversation

@zaxl

@zaxl zaxl commented Jun 10, 2013

Copy link
Copy Markdown

When editing an object the widget works as expected.
Exception occurs when adding a new object.

When editing an object the widget works as expected.
The exception occurs only when adding a new object.
@zaxl zaxl mentioned this pull request Jun 10, 2013
Comment thread bitfield/forms.py Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

needs a space after the comma

also initial isnt guaranteed to be in kwargs

@dcramer

dcramer commented Jun 10, 2013

Copy link
Copy Markdown
Collaborator

My feedback is all stylistic though I think the approach may not be very correct. This is making the assumption that there's a 64 bit integer.

@zaxl

zaxl commented Jun 10, 2013

Copy link
Copy Markdown
Author

Thanks for the feedback!.
I'm not a python expert but

isl = 1 << 63
type (isl) == int
False
type (isl) == long
True

The shift operation is promoted to long when int is 32 bits.
BigIntegerField which is the base field is also guaranteed to be 64 bits.

@SeanHayes

Copy link
Copy Markdown

This can be cancelled once #63 is merged.

Refs #58

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