Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtaining the raw value #16

Open
sposs opened this issue Oct 5, 2016 · 3 comments
Open

Obtaining the raw value #16

sposs opened this issue Oct 5, 2016 · 3 comments

Comments

@sposs
Copy link

sposs commented Oct 5, 2016

Hi,
I'm writing a small storage manager and I need to keep track of the disk usage. I can't access the file's raw size as stored in the DB because the to_python returns a 'parse_size' version of the size. Is there a way to still access the value? I'd like to increment and decrement my disk usage statistics...

@sposs
Copy link
Author

sposs commented Oct 5, 2016

Strange: the type is not right... Let's say I have a File with a 'size' declared at FileSizeField, a Disk object and a FileReplica object linking the 2, doing filereplica.db_file.size yields a unicode value of the size, not the integer value. Does that make sense?

@leplatrem
Copy link
Owner

I haven't played with Django for a while... Maybe have a look at the big integer field code in Django to see if there's any method that suits you...
Your use case seems totally consistent, there should be a way!
Don't hesitate to inspect the code here too, it's very short!
Good luck!

@sposs
Copy link
Author

sposs commented Oct 6, 2016

Ok ca marche ;)

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

No branches or pull requests

2 participants