ImportError: Attempted relative import beyond toplevel package

What I’m trying to do:
import Data to access the app tables

This is what I’ve tried

from ..... import Data

class RowTemplate1(RowTemplate1Template):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    self.approvals = Data.APPROVALS

Here APPROVALS is an app table.

The first dot means this folder.
The second one means the parent folder.
The third one means the grandparent folder.
You have 5 dots, but you don’t have a many folder levels.

Try to type from . and see what the ide suggests.

3 Likes