| Exception Type: | AttributeError |
|---|---|
| Exception Value: | 'QuerySet' object has no attribute 'expenses' |
| Exception Location: | /Users/ProductionEnv/Desktop/test/test1/dev/core/views.py in projectdetail, line 238 Please can anyone help? Best K |
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/024bc998-b683-41ae-90e2-d33f4527913a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1PoGuLeAsnJoEUuB1LdZw8SwpJDFy51%3Di89%2BAv_Zd1sOA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1NmgbP7cQtyX8uOAFX%3DXbyC6f2ug1FURabwxRgD44Mwpg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52D49AAA-5E17-4F6C-92DE-E1576F305927%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1PtFX7oNie8qZKF%3Dm7jFrCEMwTZfn%2BcvWBFSqc9FT0h4A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/06BE184B-33E5-4B84-A723-5C7075048349%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1OiCB0YW_5%2B2CcjFGJzBytRpOmKCw%3D3f_C2w-0JuESnvA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/79DB1D00-AF66-4584-B635-7C22F9673733%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAk3c1OmNHiqVgvQMHj16wiMPr23hy%3DfU%2BE4WFH8sDixpiVx5w%40mail.gmail.com.
| Exception Type: | NameError |
|---|---|
| Exception Value: | name 'project' is not defined |
| Exception Location: | /Users/ProductionEnv/Desktop/test/test1/dev/core/views.py in projectdetail, line 238 |
|---|
| Exception Type: | NameError |
|---|---|
| Exception Value: | name 'project' is not defined |
| Exception Location: | /Users/ProductionEnv/Desktop/test/test1/dev/core/views.py in projectdetail, line 239 |
|---|
Sorry my mistake
def projectdetail(request):projectList = Project.objects.all()
projectExpenseDetails = Expense.objects.select_related('project').all()
return render(request, 'busprojectdetail.html', {'project': projectList, 'expense_list': projectExpenseDetails})
Try after removing related_name='expenses' from Expenses model.On Sat, Sep 7, 2019, 2:28 AM Kean <kea...@gmail.com> wrote:Hi Bhoopesh,If this is a simple issue to resolve, please provide code which works.Reading an abstract reference, is welcome, but is not really helping to solve as one can always reference a source.Please advise solution that works, and then reference a learning resource, so user knows where to go for learning, but with solution in hand.Best,KeanOn 6 Sep 2019, at 21:54, Bhoopesh sisoudiya <bhoop...@gmail.com> wrote:On Sat, Sep 7, 2019, 2:20 AM Kean <kea...@gmail.com> wrote:Don’t understand?On 6 Sep 2019, at 21:41, Bhoopesh sisoudiya <bhoop...@gmail.com> wrote:'project' inside select_related() is foreign key in Expenses modal of Project modal.