webkom / lego Goto Github PK
View Code? Open in Web Editor NEWBackend for abakus.no
Home Page: https://lego.abakus.no
License: MIT License
Backend for abakus.no
Home Page: https://lego.abakus.no
License: MIT License
The BaseModel contains a created_by field, this should be used for storing the author. Almost all of our models extends the BasisModel anyways.
Since almost all of the mails from users on abakus.no are requests for changing which course or year they belong to, we could implement a simple "request year change" button/form on the user settings page where they include a short text describing why they would like to change year. This is essentially the same solution we use now and retains the same level of security, but removes the need for users to manually send us an e-mail about the issue.
Should be used for all API endpoints that allow listing.
This makes webkom/django-auth-abakus#37 possible.
More information: Ny Abakus.no Idédokument@Webkom Drive
If parent object is not an instance of ObjectPermissionsModel, we should check the keyword permissions for viewing the parent object.
Manage todos on abakus.no. Manage todos for other users and yourself. Connect it to other apps and make it possible to create todos based on templates.
More information: Ny Abakus.no Idédokument@Webkom Drive
Haven't investigated much, but if we could create an official Abakus Google Calendar that people can subscribe to it would probably be nicer than forcing people to download the events manually like in NERD.
Create weekly mail in the frontend. Create a new design.
More information: Ny Abakus.no Idédokument@Webkom Drive
Apps to keep: Admission, Career, Company, Contact (maybe), Event, Mail, Meeting, Pages, Quote -> Gossip/Histories/Photos?, Survey, TV, User, Useradmin.
Apps to remove:
New apps:
By deleting all migrations folders, and running python manage.py makemigrations
with all app names, we don't get the folder in lego/apps/permissions/tests/migrations
, which is necessary to be able to run python manage.py test
.
The output from running python manage.py test
:
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
psycopg2.ProgrammingError: relation "users_user" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/base.py", line 305, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute
output = self.handle(*args, **options)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/commands/test.py", line 72, in handle
failures = test_runner.run_tests(test_labels)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/test/runner.py", line 549, in run_tests
old_config = self.setup_databases()
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/test/runner.py", line 499, in setup_databases
self.parallel, **kwargs
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/test/runner.py", line 743, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/db/backends/base/creation.py", line 70, in create_test_db
run_syncdb=True,
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 130, in call_command
return command.execute(*args, **defaults)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute
output = self.handle(*args, **options)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 172, in handle
self.sync_apps(connection, executor.loader.unmigrated_apps)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 314, in sync_apps
cursor.execute(statement)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/martin/hath/webkom/lego/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "users_user" does not exist
Deleting migrations folder, and generating new ones (only tested on my system):
find lego -regex ".*migrations/.*" -delete
find lego/apps -maxdepth 1 -iname "[a-z]*" | cut -d "/" -f 3 | xargs python manage.py makemigrations
I just spent 1 1/2 hours on this 👎
To allow users to be notified when people they follow sign up to events, join interest groups and similar.
Another sort of related feature could be to allow users to invite groups they are members of to events, so that people can notify the rest of their committee/interest group or similar.
Send a link to a question form and ask why.
What permissions do we want for this? Can you edit and delete comments? If so, what rules apply?
Should automatically scale a high res photo into different sizes for the frontend.
Can use http://avatars.adorable.io/ as default (or something similar that generates different images based on the user's username/email): https://cloud.githubusercontent.com/assets/3536982/12848556/fa1093d4-cc1a-11e5-98e9-273a7af2ce56.png
Anonymous submission of gossip to readme.
Ref. number of sql-queries list events.
A usable integration with the django-admin can be problematic with our permission model.
Create a more social area around interestgroups. Mak it possible to register membership.
Replace viewsets with apiviews and mixins.
WARNINGS:
articles.Article.can_edit_groups: (fields.W340) null has no effect on ManyToManyField.
articles.Article.can_edit_users: (fields.W340) null has no effect on ManyToManyField.
articles.Article.can_view_groups: (fields.W340) null has no effect on ManyToManyField.
events.Event.can_edit_groups: (fields.W340) null has no effect on ManyToManyField.
events.Event.can_edit_users: (fields.W340) null has no effect on ManyToManyField.
events.Event.can_view_groups: (fields.W340) null has no effect on ManyToManyField.
flatpages.Page.can_edit_groups: (fields.W340) null has no effect on ManyToManyField.
flatpages.Page.can_edit_users: (fields.W340) null has no effect on ManyToManyField.
flatpages.Page.can_view_groups: (fields.W340) null has no effect on ManyToManyField.
How are we going to handle permissions?
Would be nice for development.
Could do the same for flat pages too.
Haven't done much on this for quite a while now, but we should find a solution soon. Either we have to roll our own hierarchy, or use https://github.com/django-mptt/django-mptt or similar. Last time we discussed it we leaned against making our own system, but then it has to be similar in performance to mptt.
The test fail sometimes.
Failure
Traceback (most recent call last):
File "/Users/eirsyl/Code/lego/lego/app/events/tests/test_models.py", line 475, in test_unregistering_and_bumping_post_merge
self.assertEqual(pool_one.number_of_registrations, pool_one_size_before + 1)
AssertionError: 2 != 3
Seems like we've more or less decided to use Django, but we still need to decide what we want to use for APIs.
Alternatives we've discussed so far:
PATCH/PUT/POST returns:
{
"id": 1,
"username": "webkom",
"first_name": "webkom3",
"last_name": "webkom",
"full_name": "webkom3 webkom"
}
while GET returns
{
"id": 1,
"username": "webkom",
"first_name": "webkom3",
"last_name": "webkom",
"full_name": "webkom3 webkom",
"email": "[email protected]",
"is_staff": false,
"is_active": true
}
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/core/management/base.py", line 393, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 50, in execute
return super(Command, self).execute(*args, **options)
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/core/management/base.py", line 444, in execute
output = self.handle(*args, **options)
File "/home/kotlarz/Programming/abakus/lego/venv/lib/python3.4/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 149, in handle
self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
AttributeError: 'UserManager' object has no attribute 'create_superuser'
The registrations in the development fixtures being added to events with pk 1790+, while the fixture events have pks from 1 to 50.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.