Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a3914cc1
Commit
a3914cc1
authored
Feb 01, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
course.xml includes work
parent
472a3996
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
auth/models.py
+8
-0
courseware/content_parser.py
+9
-3
settings_new_askbot.py
+5
-0
No files found.
auth/models.py
View file @
a3914cc1
...
...
@@ -14,6 +14,14 @@ class UserProfile(models.Model):
meta
=
models
.
TextField
(
blank
=
True
)
# JSON dictionary for future expansion
courseware
=
models
.
TextField
(
blank
=
True
,
default
=
'course.xml'
)
# class UserTestGroup(models.Model):
# ''' Group used for user tests.
# E.g. groupname = 'metacognition' and groupsection = ['A','B']
# '''
# groupname = models.TextField(blank=True)
# groupsection = models.TextField(blank=True)
# user = models.ManyToManyField(User)
class
Registration
(
models
.
Model
):
''' Allows us to wait for e-mail before user is registered. A
registration profile is created when the user creates an
...
...
courseware/content_parser.py
View file @
a3914cc1
...
...
@@ -3,6 +3,7 @@ import hashlib
from
lxml
import
etree
from
mako.template
import
Template
from
mako.lookup
import
TemplateLookup
try
:
# This lets us do __name__ == ='__main__'
from
django.conf
import
settings
...
...
@@ -88,12 +89,17 @@ def id_tag(course):
else
:
elem
.
set
(
'id'
,
fasthash
(
etree
.
tostring
(
elem
)))
template_lookup
=
TemplateLookup
(
directories
=
[
settings
.
DATA_DIR
],
module_directory
=
settings
.
MAKO_MODULE_DIR
)
def
course_file
(
user
):
# TODO: Cache.
filename
=
settings
.
DATA_DIR
+
UserProfile
.
objects
.
get
(
user
=
user
)
.
courseware
data_template
=
Template
(
filename
=
filename
)
filename
=
UserProfile
.
objects
.
get
(
user
=
user
)
.
courseware
data_template
=
template_lookup
.
get_template
(
filename
)
options
=
{
'dev_content'
:
True
}
tree
=
etree
.
XML
(
data_template
.
render
())
tree
=
etree
.
XML
(
data_template
.
render
(
**
options
))
id_tag
(
tree
)
return
tree
...
...
settings_new_askbot.py
View file @
a3914cc1
import
os
import
sys
import
tempfile
import
djcelery
...
...
@@ -134,10 +135,14 @@ TRACK_MAX_EVENT = 1000
MAXLOG
=
500
LOG_DIR
=
"/tmp/"
MAKO_MODULE_DIR
=
None
# Make sure we execute correctly regardless of where we're called from
execfile
(
os
.
path
.
join
(
BASE_DIR
,
"settings.py"
))
if
MAKO_MODULE_DIR
==
None
:
MAKO_MODULE_DIR
=
tempfile
.
mkdtemp
(
'mako'
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment