Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pagination to admin -> users in dashboard #175

Open
Abdur-rahmaanJ opened this issue Oct 5, 2021 · 3 comments
Open

Add pagination to admin -> users in dashboard #175

Abdur-rahmaanJ opened this issue Oct 5, 2021 · 3 comments
Assignees
Labels

Comments

@Abdur-rahmaanJ
Copy link
Member

No description provided.

@jhonDoe15
Copy link

Hi! could I be assigned to this issue?

@Abdur-rahmaanJ
Copy link
Member Author

@jhonDoe15 Done!

@jhonDoe15
Copy link

Hi @Abdur-rahmaanJ tried initializing the project and came across a some issues.
tried running these parts of the dev inialization and fell through without finding any solution online:
$ python manage.py initialise

   _____ _
  / ____| |
 | (___ | |__   ___  _ __  _   _  ___
  \___ \| '_ \ / _ \| '_ \| | | |/ _ \
  ____) | | | | (_) | |_) | |_| | (_) |
 |_____/|_| |_|\___/| .__/ \__, |\___/
                    | |     __/ |
                    |_|    |___/
Copyright 2022

Traceback (most recent call last):
  File "path\to\gitrepo\traveller\traveller\manage.py", line 4, in <module>
    cli()
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 579, in main
    return super().main(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 426, in decorator
    with __ctx.ensure_object(ScriptInfo).load_app().app_context():
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 382, in load_app
    app = self.create_app()
TypeError: _create_shopyo_app() missing 1 required positional argument: 'info'

$ flask seed dev

$ flask seed dev
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\flask.exe\__main__.py", line 7, in <module>
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 985, in main
    cli.main()
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 579, in main
    return super().main(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1651, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1698, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 535, in get_command
    return info.load_app().cli.get_command(ctx, name)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 393, in load_app
    app = locate_app(import_name, None, raise_if_not_found=False)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 234, in locate_app
    __import__(module_name)
  File "path\to\gitrepo\traveller\traveller\wsgi.py", line 19, in <module>
    base_path = os.path.dirname(os.path.abspath(__file__))
NameError: name 'os' is not defined

second one fixed by importing os in the requested file but got the next error because table wasnt created:

SEEDING FOR DEV
Adding Conference
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1819, in _execute_context
    self.dialect.do_execute(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
  File "C:\Python310\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Python310\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "C:\Python310\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "C:\Python310\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'traveller.conferences' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\flask.exe\__main__.py", line 7, in <module>
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 985, in main
    cli.main()
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 579, in main
    return super().main(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 427, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "path\to\git\repo\traveller\traveller\seed.py", line 40, in dev
    add_conf()
  File "path\to\git\repo\traveller\traveller\seed.py", line 59, in add_conf
    conf.save()
  File "C:\Users\MyUser\AppData\Roaming\Python\Python310\site-packages\shopyo\api\models.py", line 56, in save
    db.session.commit()
  File "<string>", line 2, in commit
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 1431, in commit
    self._transaction.commit(_to_root=self.future)
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 829, in commit
    self._prepare_impl()
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 808, in _prepare_impl
    self.session.flush()
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 3363, in flush
    self._flush(objects)
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 3502, in _flush
    with util.safe_reraise():
  File "C:\Python310\lib\site-packages\sqlalchemy\util\langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "C:\Python310\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
    raise exception
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\session.py", line 3463, in _flush
    flush_context.execute()
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 456, in execute
    rec.execute(self)
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 630, in execute
    util.preloaded.orm_persistence.save_obj(
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\persistence.py", line 245, in save_obj
    _emit_insert_statements(
  File "C:\Python310\lib\site-packages\sqlalchemy\orm\persistence.py", line 1238, in _emit_insert_statements
    result = connection._execute_20(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1631, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
  File "C:\Python310\lib\site-packages\sqlalchemy\sql\elements.py", line 325, in _execute_on_connection
    return connection._execute_clauseelement(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1498, in _execute_clauseelement
    ret = self._execute_context(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1862, in _execute_context
    self._handle_dbapi_exception(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 2043, in _handle_dbapi_exception
    util.raise_(
  File "C:\Python310\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
    raise exception
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1819, in _execute_context
    self.dialect.do_execute(
  File "C:\Python310\lib\site-packages\sqlalchemy\engine\default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
  File "C:\Python310\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Python310\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Python310\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "C:\Python310\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "C:\Python310\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'traveller.conferences' doesn't exist")
[SQL: INSERT INTO conferences (year, cfp_start, cfp_end) VALUES (%(year)s, %(cfp_start)s, %(cfp_end)s)]
[parameters: {'year': 2021, 'cfp_start': datetime.date(2021, 10, 1), 'cfp_end': datetime.date(2021, 10, 31)}]
(Background on this error at: https://sqlalche.me/e/14/f405)

I dont mind even helping with the docs but at the moment I dont have a clue whats needed and whats not.

as a side note, had to comment dependency cause using python 3.10 and it only supports <3.9:

Docs quote:
backports.zoneinfo;python_version<"3.9"
##backports-zoneinfo==0.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants