GithubHelp home page GithubHelp logo

genophore-s-platform-project's Introduction

Backend Task: Write a system that stores and validates the following components:

  • Document
  • Protein
  • Comment
  • Notification

the 3 first entities require the user who wrote them and the date they were created and the date they were last changed.

the notification simply requires the date it was created, and a text message field. in addition to the fields above, the protein will store the Amino Acid sequence, and its corresponding DNA sequence, both of these fields can be very long strings, up to 10 thousand characters.

also, the DNA field is always 3 times the length of the AA field, and both fields are required.

the document simply contains the content which is a text field, but we must filter out HTML elements from its content to avoid XSS attacks!!, there should be a simple function for this which we need to find.

the comment also contains the content text and should be protected from XSS attacks, and MOST importantly the comment should save which entity it belongs to, which is now a protein or a Document, but we may add more in the future.

the notification also points to an entity (comment, protein, document) and contains the notification type which can be one of "Link, static, or system" (they can be changed in the code in the future).

link notifications contain a link, and all notifications contain a message and a font- awesome icon field (a basic string field).

the requirement is to simply write classes for these entities, and we want validation over them to happen automatically when we simply call Django’s full_clean() function over objects of these models.

Please pay close attention to making the code for these models as concise as possible, try not to repeat fields, and to name variables with clear names, and comment only complex code segments or unclear model fields.

try to create 1 or 2 dummy data objects from these models just to test your syntax and validation.

The only requirement for this code is these classes, their autogenerated migrations, and a main function that instantiates objects from them and simulates different input configuration to show how correct the code is.

genophore-s-platform-project's People

Contributors

omarkady avatar

Watchers

 avatar

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.