Skip to content

Conversation

@rohanshiva
Copy link
Contributor

No description provided.

note_key = urlsafe_key(note_name)
notes.put(note_dict, note_key)
drive_notes.put(note_name, note_dict["content"])
note_dict["last_modified"] = str(datetime.now())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this create a human readable string? I always used .strftime()

note_dict["content"] = bleach.clean(note_dict["content"])
notes.put(note_dict, urlsafe_key(note.name))

drive_notes.put(note_dict["name"], str(note_dict["content"]))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll have to put it under the url safe key e.g. urlsafe_key(note.name)?

note = get_note(note_name)

else:
if note:
Copy link
Owner

@xeust xeust Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this function, if it's only a backlink update, we don't need to read & write from drive (because the content itself doesn't change).

Maybe a slight refactor of db_update_note?

Or maybe 3 functions:

  1. update_note: calls 2 & 3
  2. drive_update_note: reads / writes from Drive
  3. db_update_note: reads / writes from Base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants