Hey @akshay2 , this is actually just a configuration of VS Code that is missing.
On the bottom right corner of the window, there should be a version number for Python. By default this is the Python version of the Operating System, but Frappe uses its own version in its virtual environment.
Click that button “3.X.Y”
Click “Enter interpreter path”
Click “Find…”
Select the “python” file (or “python3” it’s the same).
from frappe.model.document import Document
class LibraryMember(Document):
def before_save(self):
self.full_name = f"{self.first_name or ''}, {self.last_name or ''}"
This is using a format string (f-string) for the full_name.