Giter VIP home page Giter VIP logo

Comments (11)

ShawnMilo avatar ShawnMilo commented on July 19, 2024

Django uses integers as primary keys by default. I prefer the use of a uuid4. Is this worth considering for these models? It prevents confusion and conflicts during import, export, and distributed storage.

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

I'm not sure about the implications in Django but I like the idea and we need uuid-s - It's currently separate from the primary key https://goo.gl/gmpedb.

from lore.

ShawnMilo avatar ShawnMilo commented on July 19, 2024

In the past, I've subclassed Django's models.Model to one that automatically uses UUIDs as the primary key, and automatically stores the date created (auto_now_add=True) and the last modified date (auto_now=True). Also, a "notes" field about any modifications made by admins, and foreign keys to the user who created and last modified them.

(Then used this model everywhere instead of models.Model).

from lore.

carsongee avatar carsongee commented on July 19, 2024

That sounds good for inheriting from a common model with extra fields. A question about the database model, is uuid in the diagram supposed to be equivalent to the OLX "url_name" that is often, but not always, a uuid? If so, we need to make sure that we don't use that uuid as a PK since there will be duplicates among different courses, and xbundle, for example, will strip those out and replace them with "human readable" IDs. If it isn't, what is the difference between the loid and the uuid, shouldn't both of them uniquely identify an object?

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

Some say it's tricky in Django: http://stackoverflow.com/a/3944247

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

@carsongee, in the current diagram uuid is machine generated.

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

Some details about the LearningObject schema :

name comment
loid Primary key ID , numeric
cid Course ID
rid Repository ID
type Learning object type (chapter, sequential, vertical, video, html etc.)
uuid UUID , uniquely identifying a learning object across LORE instances
title learning object title, extracted from xml
description user generated title/description
contentxml the XML content of the learning object
pathxml the xpath of this el in the xml doc (I think module_id here https://goo.gl/LE6Vmn
mpath the materialized path
urlpath the url to get to this learning object ("path" here https://goo.gl/LE6Vmn)
parentid the parent ID of this element
copyright string for now
xa_nr_views nr of student views for this element (will come from analytics service)
xa_nr_attempts nr of attempts (applies to items of type "problem" only)
xa_avg_grade average grade (applies to items of type "problem" only)
xa_histogram_grade histogram of grades (json type ?)

from lore.

 avatar commented on July 19, 2024

I'm changing some of the field names:
https://gist.github.com/trski/6ea8c8afb4f783c71b42
Just included some '_' for readability for the python variables and changed 'when' to 'date' so we know the field is a date type.

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

👍

from lore.

pdpinch avatar pdpinch commented on July 19, 2024

I believe this was closed by #10. @Ferdi are you OK with that?

from lore.

Ferdi avatar Ferdi commented on July 19, 2024

I think it's good for now. We can always open new issues for improvements / fixes.

from lore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.