Giter Site home page Giter Site logo

nobleascent / agrifoodit Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 1013 KB

Bachelor's Thesis Project for Telekom Innovation Laboratories at ELTE University

Home Page: http://t-labs.elte.hu/

Python 16.03% HTML 4.26% CSS 54.36% JavaScript 0.23% TeX 25.12%
django python precision-farming pig-farm

agrifoodit's People

Contributors

dependabot[bot] avatar tuqman avatar

Watchers

 avatar

agrifoodit's Issues

You are trying to add a non-nullable field 'upload' to presencefile without a default

Database Table PresenceFile was changed from:

class PresenceFile(models.Model):
    file_name = models.CharField(max_length=200)
    comments = models.CharField(max_length=200)
    upload_date = models.DateTimeField('date uploaded')
    processing_status = models.BooleanField()

to

class PresenceFile(models.Model):
    file_name = models.CharField(max_length=200)
    comments = models.CharField(max_length=200)
    upload_date = models.DateTimeField('date uploaded')
    processing_status = models.BooleanField()

    # The primary_key argument isn’t supported and will raise an error if used.
    # https://docs.djangoproject.com/en/3.1/ref/models/fields/#filefield
    # file will be uploaded to MEDIA_ROOT/uploads/presence/
    upload = models.FileField(upload_to='uploads/presence/')

After running python manage.py makemigrations the following error is returned.
Django then provides the following options:

(venv) E:\Git\AgrifoodIT>python manage.py makemigrations
You are trying to add a non-nullable field 'upload' to presencefile without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
 2) Quit, and let me add a default in models.py
Select an option: 1
Please enter the default value now, as valid Python
The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now
Type 'exit' to exit this prompt
>>> 123
Migrations for 'dashboard':
  dashboard\migrations\0002_presencefile_upload.py
    - Add field upload to presencefile

Presence Data Upload

Example file attached:
20210216_presence.txt

Example Data:

Direction ◀️▶️ Reader # 📶 RFID # Timestamp ⏲️
+ 2 8B320885DB9AF197101FA02988C06432850058E0A2266D97C0C880E0 2021-02-16T02:03:37.453
- 2 8B320885DB9AF197101FA02988C06432850058E0A2266D97C0C880E0 2021-02-16T02:03:42.454
+ 1 E2000019520602651540EA7C 2021-02-16T05:48:03.540
- 1 E2000019520602651540EA7C 2021-02-16T05:48:08.541
  • Ability to upload multiple files
  • Presence Data Model
  • Show status of files uploaded and processed
  • Background process

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.