-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Use XBlock 0.3 #839
Use XBlock 0.3 #839
Conversation
children.append(new_block) | ||
# trigger setter method by using top level field access | ||
parent_xblock.children = children | ||
parent_xblock.children.append(new_block.scope_ids.usage_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the order of diffs, it's hard to tell what you've done to create a uuid/cache for in memory usage_ids; so, I'll assume that's handled.
Probably beyond the scope of this PR, but we need a new repr for children addresses which allow structure spanning: pointing to elements in other structures. As a shortcut, we could say that a simple ID implies w/in same structure and have a different repr and logic for pointers into other structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that block locators allowed for pointers across structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block locators do, but I thought we were just persisting the usage_id not
the whole block usage locator.
On Tue, Sep 3, 2013 at 9:45 AM, Calen Pennington
notifications@github.comwrote:
In cms/djangoapps/contentstore/tests/test_crud.py:
@@ -226,10 +226,7 @@ def load_from_json(json_data, system, default_class=None, parent_xblock=None):
new_block = system.xblock_from_json(class_, usage_id, json_data) if parent_xblock is not None:
children = parent_xblock.children
children.append(new_block)
# trigger setter method by using top level field access
parent_xblock.children = children
parent_xblock.children.append(new_block.scope_ids.usage_id)
I thought that block locators allowed for pointers across structures.
—
Reply to this email directly or view it on GitHubhttps://github.com/edx/edx-platform/pull/839/files#r6125662
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be whatever id locates a particular usage (meaning, a usage inside a course). So, the usage locator, rather than the usage_id inside the locator, I guess.
Rebasing should pull in the changes Jason made to the bulk email tests |
return (self.scope_ids == other.scope_ids and | ||
self.fields.keys() == other.fields.keys() and | ||
all(getattr(self, field.name) == getattr(other, field.name) | ||
for field in self.fields.values())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner and clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason to exclude mixin fields.
We need to check whether there are unit tests and perhaps also manually test all of the views impacted by switching .fields from being local only to the union of all namespaces. |
scope_map[field.scope].add(field) | ||
return scope_map | ||
|
||
def _cache_key_from_kvs_key(self, key): | ||
""" | ||
Return the key used in the ModelDataCache for the specified KeyValueStore key | ||
Return the key used in the FieldDataCache for the specified KeyValueStore key | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function now does nothing if scope is either Scope.content
or Scope.settings
- is that intentional?
Same goes for _cache_key_from_field_object
. If this is intentional please add comments as to why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nm finally got to the docstring for DjangoKeyValueStore
|
||
def __ne__(self, other): | ||
return not self == other | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this addition (good though it looks) in this pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used so that the new method of checking XModule testing actually works.
I can't seem to successfully run cms. I think I need to rebuild my dbs. The manual tests to run:
|
|
||
# We're loading a descriptor, so student_id is meaningless | ||
# We also don't have separate notions of definition and usage ids yet, | ||
# so we use the location for both, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period?
…atus Feature/victor/per course status
Remove spaces for pep8
@nedbat @sarina @dmitchell: Can you guys review?
Scope of changes:
<block>.lms.<field>
and<block>.cms.<field>
should now just be<block>.<field>
construct_block*
methodscore
->core
,fields
)Runtime
s andFieldData
sFieldData
access should always be throughget
,set
,set_many
,delete
, rather than the dictionary interfaceScope.content
and store it in SQL to instead use one of the newUserScope.ALL
scopes