Giter Site home page Giter Site logo

Comments (19)

app-generator avatar app-generator commented on July 17, 2024 1

Hello @jorgeassuncao

The codebase will be updated soon. You've spotted a regression added by the latest commits.

Please wait.

from django-datta-able.

mominur-helios avatar mominur-helios commented on July 17, 2024 1

Hello @jorgeassuncao ,

if you use more than one "query" on a page then yes your approach is correct.

and if you want to make a "query" available on all pages then there is concept in django templatetags. You need to use django custom templatetags to achieve the expected behaviour.

from django-datta-able.

mominur-helios avatar mominur-helios commented on July 17, 2024

In home apps urls.py files just comment out the views from admin_datta and import views from home.

Just like this

Screenshot from 2023-07-27 17-01-03

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

I've made the above changes but the problem persists.

Do you need anything from me to help debig this? the complete views.py, index.html,...?

P.S.: I've just made the changes proposed on the fist post, will try now the second.

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

@mominur-helios my file is diferent from yours, are you shure this is Datta Able Django?

Readme.MD:

> Built with [App Generator](https://appseed.us/generator/), timestamp `2023-07-22 22:58`

- `Up-to-date dependencies`
- Database: `mysql`
- UI-Ready app, Django Native ORM
- `Session-Based authentication`, Forms validation
- `Dark Mode` (enhancement)
- Persistent via browser `local storage`

Changelog.md

## CodeBase version: 2stable.0.1 / 2022-01-15
### Improvements

- Dependencies update (all packages) 
  - Django==4.0.1
- Settings update for Django 4.x
  - `New Parameter`: CSRF_TRUSTED_ORIGINS
    - [Origin header checking isn`t performed in older versions](https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins)

My /apps/home/urls.py dont have admin_datta...

# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""

from django.urls import path, re_path
from apps.home import views

###
from . import views
###

urlpatterns = [

    # The home page
    path('', views.index, name='home'),

    # Matches any html file
    re_path(r'^.*\.*', views.pages, name='pages'),

]

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

Fixed in version v1.0.23.

To test, please do the following & let us know the results.

  • download the latest version
  • create two Products using Django CLI or Admin Section
  • Edit home/views.py to load products into the main template
def index(request):

  context = {
    'segment'  : 'index',
    'products' : Product.objects.all()  # <-- Uncomment this line
  }
  return render(request, "pages/index.html", context)

The HOMEpage needs to be like this:

image

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

Had this errors rinning pip3 install -r requirements.txt. Are they normal?

  DEPRECATION: django-admin-datta is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for django-admin-datta ... done
  DEPRECATION: django-api-generator is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for django-api-generator ... done
  DEPRECATION: django-dynamic-datatb is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559```

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

This is new. Let us investigate.

@mominur-helios please take a look at this warning.

TY

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

I've inserted two products.
image

They appear on Dynamic Tables.
image

But notthing on main page
image

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

This is new. Let us investigate.

@mominur-helios please take a look at this warning.

TY

image

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

Is the line UNcommented in the controller?

Products are not injected by default.

def index(request):

  context = {
    'segment'  : 'index',
    'products' : Product.objects.all()  # <-- Uncomment this line
  }
  return render(request, "pages/index.html", context)

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

Yes it is.
image

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

Can you share your repo with us?

Just add app-generator as a contributor.

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

It's done.

https://github.com/jorgeassuncao/d23e8dd6-1347-499f-85bb-88bb4507108c

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

just wait a few minutes, i'm syncyng the repo.

P.S.: It's now synced

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

The project is updated, please pull.

https://github.com/jorgeassuncao/d23e8dd6-1347-499f-85bb-88bb4507108c

You were still using the previous version. Now is updated to the latest release of Datta Able.

We recommend starting fresh with the latest version of Datta Able and adding your own code on top:

image

from django-datta-able.

jorgeassuncao avatar jorgeassuncao commented on July 17, 2024

ahhhh... Perfect!
image

I'm still new to this all Django stuff, so maybe i've made a mistake along the way. Sorry for the trouble...

Just a quick question, if i use more than one "query" on a page (results from diferent tables) whats the corret way to do it? Just add them like these?

def index(request):

  context = {
    'segment'  : 'index',
    'products' : Product.objects.all(),
    'services' : Service.objects.all()
  }
  return render(request, "pages/index.html", context)

And how to make a "query" available on all pages?

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

@mominur-helios can you advise here?

from django-datta-able.

app-generator avatar app-generator commented on July 17, 2024

Patch validated. Closing.
@jorgeassuncao let us know anytime if you need further assistance.

from django-datta-able.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.