Untis import #230

Merged
hansegucker merged 28 commits from untis-import into master 2025-05-21 22:33:46 +02:00
Owner

grafik

![grafik](/uploads/ec5b00fe94c04ffd86e3de22c9e9cc1b/grafik.png)
Member

what about subject colors?

what about subject colors?
Owner
    color = int(color)
    b, g, r = (color >> 16) & 255, (color >> 8) & 255, color & 255

    return f"#{r:02x}{g:02x}{b:02x}"
```suggestion:-6+0 color = int(color) b, g, r = (color >> 16) & 255, (color >> 8) & 255, color & 255 return f"#{r:02x}{g:02x}{b:02x}" ```
Owner

Missing doc string

Missing doc string
Owner

This is a breaking protocol change.

This is a breaking protocol change.
Owner

I am not sure this is guaranteedto work.

I am not sure this is guaranteedto work.
Owner
                                lambda f: (isinstance(f[1], ProcessFieldType)
                                and f[1].run_before_save),
```suggestion:-1+0 lambda f: (isinstance(f[1], ProcessFieldType) and f[1].run_before_save), ```
Owner
                                lambda f: (isinstance(f[1], ProcessFieldType)
                                and not f[1].run_before_save),
```suggestion:-1+0 lambda f: (isinstance(f[1], ProcessFieldType) and not f[1].run_before_save), ```
Owner

Why check this so late> Check it right at the start, and return before doing anything if the app is not installed.

Or don't even register the field type. Thinking of it, this field type should be defined in Lesrooster…

Why check this so late> Check it right at the start, and return before doing anything if the app is not installed. Or don't even register the field type. Thinking of it, this field type should be defined in Lesrooster…
Owner

See above. It becomes ever clearer that there should not be app-specific logic in here.

See above. It becomes ever clearer that there should not be app-specific logic in here.
Owner

Even more app-specific logic. Where will this get us if at some point we have 100 apps that benefit form custom CSV import logic?

Even more app-specific logic. Where will this get us if at some point we have 100 apps that benefit form custom CSV import logic?
Author
Owner

Ok, breaking in the changelog

Ok, breaking in the changelog
Author
Owner

This isn't as easy as registering app-specific field types. Do you have an idea how to do this?

This isn't as easy as registering app-specific field types. Do you have an idea how to do this?
Author
Owner

Ah, this works?

Ah, this works?
Author
Owner

What do you mean?

What do you mean?
Author
Owner

Is there a reason for this change?

Is there a reason for this change?
Author
Owner

I agree.

I agree.
Author
Owner

Ok

Ok
Owner

Of course it does, and it's the correct way to handle numbers, instead of rows of string transformations.

Of course it does, and it's the correct way to handle numbers, instead of rows of string transformations.
Owner

model(). Is it guaranteed that any model class can be instantiated without any arguments?

`model()`. Is it guaranteed that any model class can be instantiated without any arguments?
Owner

Readability (at least after you let black reformat it).

Readability (at least after you let black reformat it).
Author
Owner

Yeah, ok, thanks. I actually have never questioned this function as I wrote it like seven years ago.

Yeah, ok, thanks. I actually have never questioned this function as I wrote it like seven years ago.
Author
Owner

Yes, that's guaranteed. Saving isn't guaranteed.

Yes, that's guaranteed. Saving isn't guaranteed.
Owner

Source?

Source?
Owner

Replace the legacy views with the new frontend ;).

But, what is this import used for in the first place?

Replace the legacy views with the new frontend ;). But, what is this import used for in the first place?
Author
Owner

For setting a related validity range in the importer for matching e. g. lessons to validity ranges.

For setting a related validity range in the importer for matching e. g. lessons to validity ranges.
Owner

In that case, the Lesrooster app should offer its own frontend for the CSV importer. While keeping the logic in the CSV, the validity range should be selected in a UI provided by Lesrooster.

Maybe the import can be parameterized through the URL? I.e., Lesrooster has a button in the validity range view to "Import data from CSV", and this links to CSVImport's job creation wizard, passing the validity range along in the URL? This mechanism should be agnostic of the semantics of the passed parameter, e.g. by storing the parameters in the import job, and letting the field type directly use the stored parameters in its logic.

In that case, the Lesrooster app should offer its own frontend for the CSV importer. While keeping the logic in the CSV, the validity range should be selected in a UI provided by Lesrooster. Maybe the import can be parameterized through the URL? I.e., Lesrooster has a button in the validity range view to "Import data from CSV", and this links to CSVImport's job creation wizard, passing the validity range along in the URL? This mechanism should be agnostic of the semantics of the passed parameter, e.g. by storing the parameters in the import job, and letting the field type directly use the stored parameters in its logic.
Author
Owner
https://docs.djangoproject.com/en/5.0/ref/models/instances/#creating-objects
Author
Owner

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42873&start_sha=93972ca94ddde9dd6beb1402c29df86e003901d5#2e4d37df60a5f30ec3b3d2fb2c9809be04ec44b0_92_88)
Author
Owner

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42873&start_sha=93972ca94ddde9dd6beb1402c29df86e003901d5#872b5d39641fbd56bbcdcc18dab8e328076e33e6_266_265)
Author
Owner

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42873&start_sha=93972ca94ddde9dd6beb1402c29df86e003901d5#872b5d39641fbd56bbcdcc18dab8e328076e33e6_289_289)
Author
Owner

added 3 commits

Compare with previous version

added 3 commits <ul><li>57d547fd - Tidy up changes</li><li>39c5528a - Use Subject from Cursus everywhere</li><li>1630905b - Update changelog</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42873&start_sha=93972ca94ddde9dd6beb1402c29df86e003901d5)
Author
Owner

added 1 commit

  • d82663f9 - Migrate to RegistryObject for field types

Compare with previous version

added 1 commit <ul><li>d82663f9 - Migrate to RegistryObject for field types</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42884&start_sha=1630905b33bb020d23fcbe490215d69401b26b0a)
Author
Owner

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42890&start_sha=d82663f9382486c5dd79bd068ca702a0c6395a0e#109f1a1af772b7d4ac38456a0cd912e2eb4a2e76_673_625)
Author
Owner

added 1 commit

  • b65c7a18 - Factor out some app-specific field types

Compare with previous version

added 1 commit <ul><li>b65c7a18 - Factor out some app-specific field types</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=42890&start_sha=d82663f9382486c5dd79bd068ca702a0c6395a0e)
Author
Owner

added 1 commit

  • 0d67ff9c - Add field type for creating users from username

Compare with previous version

added 1 commit <ul><li>0d67ff9c - Add field type for creating users from username</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=43558&start_sha=b65c7a18537fd0de4692e6ba328d1eaab4121a77)
Author
Owner

assigned to @hansegucker

assigned to @hansegucker
Author
Owner

unassigned @hansegucker

unassigned @hansegucker
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>cdc9c105 - Don&#39;t fail on existign users</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=49114&start_sha=0d67ff9cfe87f3a97eea141014c5472406370fdf)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>0fa8389d - Fix username import</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=49143&start_sha=cdc9c10559c0d86b5871dc8aed87d43c26ff5a63)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>401e4733 - Fix username import</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=49145&start_sha=0fa8389d2ef4f0388cb7b15c6591e78fb18af087)
Author
Owner

@hansegucker checks.

@hansegucker checks.
Author
Owner

changed this line in version 9 of the diff

changed this line in [version 9 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=60307&start_sha=401e4733d9c079fb2f589191cb16da14c33792f7#872b5d39641fbd56bbcdcc18dab8e328076e33e6_250_250)
Author
Owner

added 55 commits

  • 401e4733...f614cde0 - 53 commits from branch master
  • ad88cc21 - Merge branch 'master' into untis-import
  • 21d848de - Fix compatibility with Core 4.0 and fix tests

Compare with previous version

added 55 commits <ul><li>401e4733...f614cde0 - 53 commits from branch <code>master</code></li><li>ad88cc21 - Merge branch &#39;master&#39; into untis-import</li><li>21d848de - Fix compatibility with Core 4.0 and fix tests</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=60307&start_sha=401e4733d9c079fb2f589191cb16da14c33792f7)
Author
Owner

changed the description

changed the description
Author
Owner

changed this line in version 10 of the diff

changed this line in [version 10 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=60663&start_sha=21d848de19a7f09056df40f1b8d1ece4c6421ead#1688647f4192433047a296616a09edbb743097c6_14_12)
Author
Owner

changed this line in version 10 of the diff

changed this line in [version 10 of the diff](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=60663&start_sha=21d848de19a7f09056df40f1b8d1ece4c6421ead#1688647f4192433047a296616a09edbb743097c6_36_25)
Author
Owner

added 2 commits

  • 9963c5e0 - Provide demo template
  • d2023c90 - Move import to new frontend and support additional params from other apps

Compare with previous version

added 2 commits <ul><li>9963c5e0 - Provide demo template</li><li>d2023c90 - Move import to new frontend and support additional params from other apps</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=60663&start_sha=21d848de19a7f09056df40f1b8d1ece4c6421ead)
Author
Owner

mentioned in merge request AlekSIS-App-Lesrooster!178

mentioned in merge request AlekSIS-App-Lesrooster!178
Author
Owner

resolved all threads

resolved all threads
Author
Owner
Blocked by https://edugit.org/AlekSIS/official/AlekSIS-Core/-/merge_requests/1808
Author
Owner

Correctly respect school term of groups for courses, also respect school term and validity range for lessons

Correctly respect school term of groups for courses, also respect school term and validity range for lessons
Author
Owner

added 3 commits

  • ee5c6fdc - Fix and improve import process after merge
  • 60955320 - Also allow plain files for import
  • 0e86a312 - Fix and adapt Untis import

Compare with previous version

added 3 commits <ul><li>ee5c6fdc - Fix and improve import process after merge</li><li>60955320 - Also allow plain files for import</li><li>0e86a312 - Fix and adapt Untis import</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=61756&start_sha=d2023c90c3a1ce07637720fb655744115249fb69)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>c2188ffa - Update deps</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-CSVImport/-/merge_requests/155/diffs?diff_id=61775&start_sha=0e86a31257b78858bf2dadc650cb1aec5417b4de)
Author
Owner

assigned to @hansegucker

assigned to @hansegucker
Author
Owner

mentioned in commit 7c9095a9af

mentioned in commit 7c9095a9af7673f9a513180255b9e483b04b750a
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-CSVImport!230
No description provided.