Re: Support for moving a model between two Django apps #24686

2021-06-03 Thread Mike Dewhirst
On 4/06/2021 2:28 pm, lalit suthar wrote: We had a similar problem and we resolved it by moving all the models into a separate internal python package. We can have a separate app in our django project also for writing models only and all other apps import models from there. Interesting. What

Re: Support for moving a model between two Django apps #24686

2021-06-03 Thread lalit suthar
We had a similar problem and we resolved it by moving all the models into a separate internal python package. We can have a separate app in our django project also for writing models only and all other apps import models from there. On Friday, 4 June 2021 at 06:07:53 UTC+5:30 Mike Dewhirst wrot

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
my pleasure :) On Thu, 3 Jun 2021 at 20:28, Eugene TUYIZERE wrote: > Dear Suthar, > > Thank you very much. It works well. > > > On Thu, 3 Jun 2021 at 16:48, Lalit Suthar > wrote: > >> not sure but maybe this can work inside views replace >> chart = { >> 'chart': {'type': 'column'}, >>

Re: model configuration

2021-06-03 Thread Mike Dewhirst
On 4/06/2021 1:39 pm, Mike Dewhirst wrote: On 4/06/2021 11:34 am, frank dilorenzo wrote: I have the following conditions. A supplier can have many shipments. A shipment can have many species. A shipment can have only one supplier. Species can belong to many shipments. supplier 1:n shipment shi

Re: Retreive User IP Address and other details through HTML Form

2021-06-03 Thread sachinbg sachin
When we host in server always it shows the our hosted server ip address ,not the users IP address, I tried collecting ip from the request it's giving the hosted server ip address. Thanks and regards Sachin B.G On Fri, 4 Jun, 2021, 2:16 AM Stephen olumide, wrote: > Wow...thanks for the response.

Re: model configuration

2021-06-03 Thread Mike Dewhirst
On 4/06/2021 11:34 am, frank dilorenzo wrote: I have the following conditions. A supplier can have many shipments. A shipment can have many species. A shipment can have only one supplier. Species can belong to many shipments. supplier 1:n shipment shipment n:m species No matter how I try I c

model configuration

2021-06-03 Thread frank dilorenzo
I have the following conditions. A supplier can have many shipments. A shipment can have many species. A shipment can have only one supplier. Species can belong to many shipments. No matter how I try I can't seem to configure the models correctly. I was hoping someone could help me on this.

Support for moving a model between two Django apps #24686

2021-06-03 Thread Mike Dewhirst
I can see a ticket https://code.djangoproject.com/ticket/24686 which would likely solve my current need to merge two apps. Is the code OK to try out? Happy to test it. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you

Re: Retreive User IP Address and other details through HTML Form

2021-06-03 Thread Stephen olumide
Wow...thanks for the response. Yes we are all on same network in an organization. I will send view.py and index.html code later, it's 9:46pm here. Regards On Thu, Jun 3, 2021, 6:54 PM Kasper Laudrup wrote: > On 03/06/2021 12.04, Stephen olumide wrote: > > Hello Everyone, > > I need help with my

Re: Retreive User IP Address and other details through HTML Form

2021-06-03 Thread Kasper Laudrup
On 03/06/2021 12.04, Stephen olumide wrote: > Hello Everyone, > I need help with my Django web app, see link below > https://caryang.pythonanywhere.com It would be much more useful if you could link to the source code, or even better, the relevant snippets instead. > I need the form to display/po

Re: use of annotate in django query

2021-06-03 Thread Eugene TUYIZERE
Dear Suthar, Thank you very much. It works well. On Thu, 3 Jun 2021 at 16:48, Lalit Suthar wrote: > not sure but maybe this can work inside views replace > chart = { > 'chart': {'type': 'column'}, > 'title': {'text': 'Previous statistics'}, > 'xAxis': {'replist': replist}, >

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
not sure but maybe this can work inside views replace chart = { 'chart': {'type': 'column'}, 'title': {'text': 'Previous statistics'}, 'xAxis': {'replist': replist}, 'series': [arriva_days] } with chart = { 'chart': {'type': 'column'}, 'title': {'text': 'Previous

Re: Facing problem to display dynamic (name,description of places AND price)on the web page using Django

2021-06-03 Thread Michael Smith
You can't have three of the same name view either can you? On Thu, Jun 3, 2021 at 9:36 AM Nandaniya Nilesh < nileshnandaniya...@gmail.com> wrote: > hello, > I am nilesh, > i think every funtion should return something. > > return dests from index named function. > last line is not with any functi

Re: Facing problem to display dynamic (name,description of places AND price)on the web page using Django

2021-06-03 Thread Nandaniya Nilesh
hello, I am nilesh, i think every funtion should return something. return dests from index named function. last line is not with any function def main(): .. def index(): .. return dest1 def index(): .. return dest2 def index(): .. return dest3 dests = [...] return render(...

Facing problem to display dynamic (name,description of places AND price)on the web page using Django

2021-06-03 Thread UJJWAL AGRAWAL
Dear team I am facing a problem with error While writing this code ERROR IS: RETURN OUTSIDE FUNCTION Please help me solving this issue. from django.shortcuts import render from .models import Destination # Create your views here. def index(request): dest1 = Destination() dest1.name ='

Retreive User IP Address and other details through HTML Form

2021-06-03 Thread Stephen olumide
Hello Everyone, I need help with my Django web app, see link below https://caryang.pythonanywhere.com I need the form to display/populate the following: - Username - System Name - IP Address - MAC Address The user can fill remaining fields manually: - System Brand - System Type - Model - Location

Re: use of annotate in django query

2021-06-03 Thread Eugene TUYIZERE
This what I have in summarizedchart.html: {% extends "layouts/base.html" %} {% load static %} {% block title %} Repport {% endblock %} {% block stylesheets %}{% endblock stylesheets %} {% block content %} Report Highcharts.chart('container', {{ chart|safe }}); {% endblock con

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
so the view is not giving error right now but maybe we are passing the data in different format then the chart is expecting. What are you using for drawing the chart? can I see the code inside "summarizedchart.html" On Thu, 3 Jun 2021 at 17:43, Eugene TUYIZERE wrote: > Dear Suthar, > > You saved

Re: use of annotate in django query

2021-06-03 Thread Eugene TUYIZERE
Dear Suthar, You saved my day. Once more, the chart is displayed but the date is not displayed on Xaxis. This how it is: [image: image.png] Th codes are: def reqChart(request): current_date = date.today() days_before = date.today()-timedelta(days=30) datelist = Customer_Requests.objects.values("

Re: use of annotate in django query

2021-06-03 Thread lalit suthar
Hi there! make these couple of changes 1) from django.core.serializers.json import DjangoJSONEncoder 2) dump3 = json.dumps(chart3, cls=DjangoJSONEncoder) On Thursday, 3 June 2021 at 16:18:15 UTC+5:30 eugenet...@gmail.com wrote: > Dear Suthar, > > Your idea works well , but I want now to displa

Re: use of annotate in django query

2021-06-03 Thread Eugene TUYIZERE
Dear Suthar, Your idea works well , but I want now to display the result on chart. Below is the code I am trying to use: but Am getting the error message: Exception Value: Object of type date is not JSON serializable def reqChart(request): aa = Customer_Requests.objects.values("arrival_date").

Re: Business logic constants

2021-06-03 Thread yuriy polonskiy
Thank for your response On Monday, May 31, 2021 at 8:35:11 AM UTC+3 Derek wrote: > There are many types of constants. We have a 'utils' directory (at same > level as 'apps') and under that 'constants' sub-directory - with different > files for different types of constants that are generally app

Re: CSS not linking with HTML

2021-06-03 Thread sukhy gill
Dear frnd First of all thanks to all for spare your valueable time for me.🙏🙏 Now my Server is working and inline CSS also working but Internal and External CSS not working. In my last project, image css was also working but now it is not working. Another problem is "python manage.py col