Re: Migrating a code written in flask framework to django.

2021-03-12 Thread Ernest Thuku
I don't think there is a proper way to convert flak to Django but if you
know how python well you can rewrite from flask to Django its not that
difficult. This will happen if atleast you know how to work with Django.

On Fri, 12 Mar 2021 21:50 GEETHANJALI S P, 
wrote:

> Hi all,
> Suppose a program is written in flask framework how can we convert it into
> django?
> Thanks in advance.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMKAcOJQZ5jM7vHScUTUhj7iANW2M-v0AJtcfSWnynsCsXpbEA%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofTj0oOBMoVnSVEmHCwASua5ESVvfexvhK_k9VZ%3DVbmLQ%40mail.gmail.com.


Re: How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-26 Thread Ernest Thuku
Well thank you so much for this...I really appreciate..let me try it and I
will let you know

On Wed, 27 Jan 2021 03:12 Gabriel Araya Garcia, 
wrote:

> In top of views files (views.py) you must put:
> import openpyxl
> from openpyxl import Workbook
> from openpyxl.styles import Alignment,Border,Font,PatternFill,Side
> from openpyxl.styles import colors
> from openpyxl.styles import Font, Color,Fill
> from openpyxl.styles.borders import BORDER_THIN
> from openpyxl.drawing.image import Image as XLIMG
>
> ...and the view which prepare the excel out, you should review this
> example:
>
> # CARTOLA DE RECAUDACION en excel
> @login_required(login_url='login_ini')
> def acsv(request):
> nom_arch = nombrearch() # Se forma string para nombre de archivo excel
> string_nombre = 'pac'+nom_arch
> query = Pauta_aux.objects.all().order_by('rut') # viene filtrada x rango
> de fecha
>
> reg_x = 0
> if query:
> for fech_x in query:
> reg_x = reg_x + 1
> else:
> # estas dos instrucciones van juntas siempre
> messages.error(request, "No existen movimientos que mostrar !!")
> return redirect("info")
>
> mes_x = fechapautas.strftime('%m')
> ano_x = fechapautas.strftime('%Y')
> fecha_ini = str(ano_x)+"-"+str(mes_x).zfill(2)+"-01 00:00:00"
> #total dias del mes
> totdias = calendar.monthrange(int(ano_x),int(mes_x))[1]
> fecha_fin = str(ano_x)+"-"+str(mes_x).zfill(2)+"-"+str(totdias)+" 00:00:00"
> wb = Workbook()
> ws = wb.create_sheet("hoja1",0)
> ws.column_dimensions['A'].width = 5
> ws.column_dimensions['B'].width = 12 # rut paciente
> ws.column_dimensions['C'].width = 36 # nombre paciente
> ws.column_dimensions['D'].width = 17 # fecha
> ws.column_dimensions['E'].width = 11 # rut cuid.
> ws.column_dimensions['F'].width = 23 # nombre cuidador
> ws.column_dimensions['G'].width = 12 # tipo cuidador
> ws.column_dimensions['H'].width = 11 # rut cuid.
> ws.column_dimensions['I'].width = 23 # nombre cuidador
> ws.column_dimensions['J'].width = 12 # tipo cuidador
> ws.column_dimensions['K'].width = 11 # rut cuid.
> ws.column_dimensions['L'].width = 23 # nombre cuidador
> ws.column_dimensions['M'].width = 12 # tipo cuidador
>
> ws.column_dimensions['Q'].width = 12 # rut cuid.
> ws.column_dimensions['R'].width = 14# nombre cuidador
> ws.column_dimensions['S'].width = 12 # tipo cuidador
> ws.column_dimensions['T'].width = 14 # tipo cuidador
>
> r=4 # posicion de la primera fila
> ws.cell(row=r-3,column=2).value = "CARTOLA DE RECAUDACION"
> ws.cell(row=r-3,column=7).value = "1=Contratado"
> ws.cell(row=r-2,column=7).value = "2=Extra"
>
> ws.cell(row=r-3,column=20).value = "1=Normal"
> ws.cell(row=r-2,column=20).value = "2=Domingo"
> ws.cell(row=r-1,column=20).value = "3=Festivo"
>
> ws.cell(row=r,column=2).value = "Rut paciente"
> ws.cell(row=r,column=3).value = "Paciente"
> ws.cell(row=r,column=4).value = "Fecha pauta"
>
> ws.cell(row=r,column=5).value = "Rut turno 1"
> ws.cell(row=r,column=6).value = "Cuidador t1"
> ws.cell(row=r,column=7).value = "Tipo Cuid t1"
>
> ws.cell(row=r,column=8).value = "Rut turno 2"
> ws.cell(row=r,column=9).value = "Cuidador t2"
> ws.cell(row=r,column=10).value = "Tipo Cuid t2"
>
> ws.cell(row=r,column=11).value = "Rut turno 3"
> ws.cell(row=r,column=12).value = "Cuidador t3"
> ws.cell(row=r,column=13).value = "Tipo Cuid t3"
>
> ws.cell(row=r,column=14).value = "$ turno 1"
> ws.cell(row=r,column=15).value = "$ turno 2"
> ws.cell(row=r,column=16).value = "$ turno 3"
>
> ws.cell(row=r,column=17).value = "$ paciente t1"
> ws.cell(row=r,column=18).value = "$ paciente t2"
> ws.cell(row=r,column=19).value = "$ paciente t3"
>
> ws.cell(row=r,column=20).value = "recargo"
> ws.cell(row=r,column=21).value = "Tot.turnos"
> cell_range = ws['B1':'T4']
> #cell_range.bold = True
>
> tot1=0 # valores de cuidador
> tot2=0
> tot3=0
> tot_pac1 = 0 # valores de paciente (o lo que pagael apoderado)
> tot_pac2 = 0 # valores de paciente (o lo que pagael apoderado)
> tot_pac3 = 0 # valores de paciente (o lo que pagael apoderado)
> va1=0
> va2=0
> va3=0
>
> tRecauda = 0
> subtot = 0
> rut_x = ''
> r=r+1
> for q in query: # pauta_aux - dia a dia
> if q.rut != rut_x:
> ws.cell(row=r,column=20).value = "Subtotal:"
> ws.cell(row=r,column=21).value = subtot
>
> r=r+1
> ws.cell(row=r,column=20).value = "Tot.Anticipo:"
> totAnticipo = anticipos(rut_x,fecha_ini,fecha_fin)
>
> ws.cell(row=r,column=21).value = totAnticipo
>
> r=r+1
> ws.cell(row=r,column=20).value = "Recauda:"
> ws.cell(row=r,column=21).value = subtot - totAnticipo
>
> tRecauda = 0
> subtot = 0
>
> va1=0
> va2=0
> va3=0
>
> rut_x = q.rut # paciente
> r=r+2
>
> ws.cell(row=r,column=2).value = q.rut
> ws.cell(row=r,column=3).value = q.paciente
> ws.cell(row=r,column=4).value = q.fecha   # fecha de la pauta
>
> ws.cell(row=r,column=5).value = q.rut_t1   # rut cuidador
> ws.cell(row=r,column=6).value = q.turno1 # nombre cuidador
> ws.cell(row=r,column=7).value = q.tipo_turno1 # Contratado - Extra
>
> ws.cell(row=r,column=8).value = q.rut_t2   # rut cuidador
> ws.cell(row=r,colum

Re: How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-26 Thread Ernest Thuku
Yeah that is what I am talking about. I need  to integrate this screenshot
below in django now. The link name, distance etc to be in  a form.


On Tue, Jan 26, 2021 at 9:58 PM Kasper Laudrup 
wrote:

> On 26/01/2021 15.19, Ernest Thuku wrote:
> > Hey Kasper, yes I ned to save it as a model so that i can use it to
> > access information.
> >
>
> OK, so what you really want to do is to create a model with the same
> fields as the ones in your spreadsheet and then import your data into
> that model?
>
> /Kasper
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3d0d33b8-f422-485c-ff59-3b4dcf5c5f74%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuocuz9iw-_HJ-TK3ezRq9wAZWu%2B8ifATWMRpZ7tiS1ud_w%40mail.gmail.com.


Re: How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-26 Thread Ernest Thuku
Hey Kasper, yes I ned to save it as a model so that i can use it to
access information.

On Mon, Jan 25, 2021 at 3:03 PM Kasper Laudrup 
wrote:

> Hi Ernest,
>
> On 25/01/2021 10.43, Ernest Thuku wrote:
> > Hello kasper, thank you so much for the information. I know how to use
> > the django forms. The issue was where will I include the python file
> > above.
>
> I'm not sure I understand the problem. The file you posted earlier just
> contains a Python function. You can copy that function into your views
> file or import the function like any other Python function.
>
> > If I decide to uploadthe excel file and put store it in the
> > django admin, how will I access its content. I hope its clear now maybe
> > you can help.
> >
>
> Not sure what you mean by "store it in the django admin"? Do you want to
> save it in a model that you can access/modify from Django Admin?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/eb2f8e35-4a93-c2a6-030c-4584bb3090f4%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuoeCO5z0jJD_3Kg2Y0LS48rsX575eGhc%2BsyOkRfwLcXp8w%40mail.gmail.com.


Re: How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-25 Thread Ernest Thuku
this is the view to the model form that i have created.
def findFault(request):
form = findForm(request.POST or None)
if form.is_valid():
instance = form.save(commit=False)
instance.user = request.user
instance.save()
return redirect("home")
context = {
'form': form,

}
return render(request, 'findFault.html', context)

On Mon, Jan 25, 2021 at 12:43 PM Ernest Thuku  wrote:

> Hello kasper, thank you so much for the information. I know how to use the
> django forms. The issue was where will I include the python file above. If
> I decide to uploadthe excel file and put store it in the django admin, how
> will I access its content. I hope its clear now maybe you can help.
>
> On Mon, Jan 25, 2021 at 12:36 PM Kasper Laudrup 
> wrote:
>
>> Hi Ernest,
>>
>> On 25/01/2021 10.25, Ernest Thuku wrote:
>> > Hello Everyone,
>> > I have a python file which I run on the terminal and give me the result
>> > that I want. I want to to do the same via a web app whereby instead of
>> > interacting with the terminal, I can do that via a browser through a
>> > form. I have decided to choose django as the server. Below is the file
>> > that I need to integrate to django. It works well in the terminal. I
>> > also have the excel file.
>> > Now my concern was how can I integrate it with django such that fields
>> > like link_name can be filed through a form and when I click a button
>> > should give the required results. Thank you fo your time.
>> >
>>
>> Sounds like that should be very simple to do. Have you had a look at how
>> Django uses forms:
>>
>> https://docs.djangoproject.com/en/3.1/topics/forms/
>>
>> If you don't have any experience with Django (to be honest, it sounds a
>> bit like that) it would probably be a very good idea to start with the
>> tutorial:
>>
>> https://docs.djangoproject.com/en/3.1/intro/tutorial01/
>>
>> After you've been through that, you should have a pretty good idea on
>> what to do. If you have any problems after that, then share the code
>> here and I'm sure someone will help you with the specific problems you
>> might face.
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/cccd51fe-e2d7-37b6-4439-afe0f0b4a4c7%40stacktrace.dk
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofjHNF2OcVB%3DMzk2AeHm7VYYGYUhpNJ79pwJjTQmMacaQ%40mail.gmail.com.


Re: How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-25 Thread Ernest Thuku
Hello kasper, thank you so much for the information. I know how to use the
django forms. The issue was where will I include the python file above. If
I decide to uploadthe excel file and put store it in the django admin, how
will I access its content. I hope its clear now maybe you can help.

On Mon, Jan 25, 2021 at 12:36 PM Kasper Laudrup 
wrote:

> Hi Ernest,
>
> On 25/01/2021 10.25, Ernest Thuku wrote:
> > Hello Everyone,
> > I have a python file which I run on the terminal and give me the result
> > that I want. I want to to do the same via a web app whereby instead of
> > interacting with the terminal, I can do that via a browser through a
> > form. I have decided to choose django as the server. Below is the file
> > that I need to integrate to django. It works well in the terminal. I
> > also have the excel file.
> > Now my concern was how can I integrate it with django such that fields
> > like link_name can be filed through a form and when I click a button
> > should give the required results. Thank you fo your time.
> >
>
> Sounds like that should be very simple to do. Have you had a look at how
> Django uses forms:
>
> https://docs.djangoproject.com/en/3.1/topics/forms/
>
> If you don't have any experience with Django (to be honest, it sounds a
> bit like that) it would probably be a very good idea to start with the
> tutorial:
>
> https://docs.djangoproject.com/en/3.1/intro/tutorial01/
>
> After you've been through that, you should have a pretty good idea on
> what to do. If you have any problems after that, then share the code
> here and I'm sure someone will help you with the specific problems you
> might face.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cccd51fe-e2d7-37b6-4439-afe0f0b4a4c7%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofhOiS4hwZb0W5U8%2BVcM3oP9LjiTsaHc%3DCAxH875dzL4A%40mail.gmail.com.


How to intergrate openpyxl with django and using the excel sheet as the database to query data

2021-01-25 Thread Ernest Thuku
Hello Everyone,
I have a python file which I run on the terminal and give me the result
that I want. I want to to do the same via a web app whereby instead of
interacting with the terminal, I can do that via a browser through a form.
I have decided to choose django as the server. Below is the file that I
need to integrate to django. It works well in the terminal. I also have the
excel file.
Now my concern was how can I integrate it with django such that fields like
link_name can be filed through a form and when I click a button should give
the required results. Thank you fo your time.

def find_fault(request):
wb = xl.load_workbook("Find Fault App Documentation.xlsx")
link_name = input("Link Name: ")
test_location = input("Test Location: ")
distance = float(input("Distance of Fault(km): "))
error = int(input("Error margin(m): "))
nature = input("Nature of Fault: ").lower()
for sheet in wb.worksheets:
if sheet.title == link_name:
for i in range(2, sheet.max_row + 1):
cell0 = sheet.cell(i, 1)
if cell0.value == test_location:
distance1 = distance * 1000 + sheet.cell(i, 2).value
for value in range(2, sheet.max_row + 1):
cell = sheet.cell(value, 2)
cell1 = sheet.cell(value, 1)
cell2 = sheet.cell(value, 3)
if cell.value in range(int(distance1) - error, int(distance1) + error):
if nature == "kink":
print()
print("Kink at {cell1.value}")
print("Pairs at this point:")
print(cell2.value)
elif nature == "break":
print()
print("Break at {cell1.value}")
print("Pairs at this point:")
print(cell2.value)
else:
print()
print("Fault at {cell1.value}")
print("Pairs at this point:")
print(cell2.value)

for value in range(2, sheet.max_row):
cell1 = sheet.cell(value, 2)
cell2 = sheet.cell(value + 1, 2)
cell3 = sheet.cell(value, 4)
cell4 = sheet.cell(value, 1)

if distance1 in range(cell1.value, cell2.value):
if distance1 in range(cell1.value + error, cell2.value - error):
if nature == "kink":
print()
print("Kink at {(distance1 - cell1.value) / 1000} "
"km from {cell4.value}")
print(
"Pair at this point >> {cell3.value}")
elif nature == "break":
print()
print("Break at {(distance1 - cell1.value) / 1000} "
"km from {cell4.value}")
print(
"Pair at this point >> {cell3.value}")
else:
print()
print("Fault at {(distance1 - cell1.value) / 1000} "
"km from {cell4.value}")
print(
"Pair at this point >> {cell3.value}")

if distance * 1000 > (sheet.cell(sheet.max_row, 2).value -
(sheet.cell(i, 2).value
+ error)):
print()
print(
"The Distance from {test_location} to {sheet.cell(sheet.max_row, 1).value} "
)
print("is about "
"{(sheet.cell(sheet.max_row, 2).value - sheet.cell(i, 2).value) / 1000} km")

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofr_6gYz20tjU%3De751rcV%2Bi%3D7j6VfzTppCwmKfsajhO%3DA%40mail.gmail.com.


Re: Openpyxl with Django

2021-01-12 Thread Ernest Thuku
Thank you so much..I want to upload it and then return the contents of the
excel sheet to the templates and display it on the browser.

On Tue, 12 Jan 2021 19:21 Kasper Laudrup,  wrote:

> Hi Ernest,
>
> On 12/01/2021 15.21, Ernest Thuku wrote:
> > Hello, I need a way I can connect a python script that reads excel file
> > using openpyxl and instead of interacting with the terminal/cmd I can
> > interact it via a web app(in browser). Thank you.
> >
>
> The simplest would most likely be to call the script (or preferably, a
> function in the script) from a view and then render a template with the
> data returned from the function.
>
> Of course, a lot of details are missing like where the Excel file comes
> from and what you mean by "interact with it", but that should be a start
> I hope.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2f8bde94-5889-623a-4b3e-83427d220c56%40stacktrace.dk
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuoe1aG4%2BtzVYAj2otGUy1RfmFfUs%3D0JhHi4PEi5HW7oNug%40mail.gmail.com.


Openpyxl with Django

2021-01-12 Thread Ernest Thuku
Hello, I need a way I can connect a python script that reads excel file
using openpyxl and instead of interacting with the terminal/cmd I can
interact it via a web app(in browser). Thank you.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuof3oSn3Sh%2B3Cbk8D0RVSDTKPyGLhMOtYZjcLyrvpwy0Pg%40mail.gmail.com.


Re: How to calculate appreciation in django

2020-09-16 Thread Ernest Thuku
m concen is how I can calculate appreciation...the formula

On Wed, Sep 16, 2020 at 10:37 PM coolguy 
wrote:

> Did you setup the limits and maintenance dates in your asset models?
>
> If yes, then did you create any view that is available to designated user
> who can run that report to see what is due for maintenance and re-ordering.
>
> Please share more detail..
>
> On Wednesday, September 16, 2020 at 12:03:56 PM UTC-4 ernes...@gmail.com
> wrote:
>
>> This is an example of a reorder level function in views.py
>> def reorder_level(request, pk):
>> queryset = Asset.objects.get(id=pk)
>> form = ReorderLevelForm(request.POST or None, instance=queryset)
>> if form.is_valid():
>> instance = form.save(commit=False)
>> instance.save()
>> messages.success(request, "Reorder level for " + str(instance.item_name)
>> + " is updated to " + str(instance.reorder_level))
>> return redirect("list_items")
>> context = {
>>"instance": queryset,
>>"form": form,
>> }
>> return render(request, "add_items.html", context)
>>
>> On Wed, Sep 16, 2020 at 6:58 PM Ernest Thuku  wrote:
>>
>>> The system is a managing system whereby you maage Items like the stock
>>> system, this one manages assets likes furniters,computers etc. The item is
>>> added in the system and the system can be able to offer an alert when a
>>> certain item is below where the reorder level is. The system can also be
>>> able to alert on maintenance dates whereby after a certain period it alerts
>>> it need to be maintained. I wanted to add a functionality whereby the
>>> system can be able to calculate either depreciation or appreciation on the
>>> asset.
>>>
>>>
>>> On Wed, Sep 16, 2020 at 6:47 PM Akorede Habeebullah 
>>> wrote:
>>>
>>>> Can you be more elaborate?
>>>> How does the system work?
>>>>
>>>> *Akorede Habeebullah A.*
>>>> *hda...@gmail.com*
>>>> *+2348179564316 <+234%20817%20956%204316>*
>>>>
>>>>
>>>> On Wed, Sep 16, 2020 at 4:43 PM Ernest Thuku 
>>>> wrote:
>>>>
>>>>> Hello guys,
>>>>> I have developed a system to manage assets. It is more like a stock
>>>>> management system whereby the system has a reorder level and such. Anyone
>>>>> who can help me to apply appreciation/depreciation code?
>>>>>
>>>>> --
>>>>> 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/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> 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/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2d47a010-e347-4d2a-8ac4-416fa89ff815n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2d47a010-e347-4d2a-8ac4-416fa89ff815n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuoePSdtA7x1qWJ6TXchtKOCRqU9ztzr2_ne6_QyWe9GOCQ%40mail.gmail.com.


Re: How to calculate appreciation in django

2020-09-16 Thread Ernest Thuku
This is an example of a reorder level function in views.py
def reorder_level(request, pk):
queryset = Asset.objects.get(id=pk)
form = ReorderLevelForm(request.POST or None, instance=queryset)
if form.is_valid():
instance = form.save(commit=False)
instance.save()
messages.success(request, "Reorder level for " + str(instance.item_name) +
" is updated to " + str(instance.reorder_level))
return redirect("list_items")
context = {
   "instance": queryset,
   "form": form,
}
return render(request, "add_items.html", context)

On Wed, Sep 16, 2020 at 6:58 PM Ernest Thuku  wrote:

> The system is a managing system whereby you maage Items like the stock
> system, this one manages assets likes furniters,computers etc. The item is
> added in the system and the system can be able to offer an alert when a
> certain item is below where the reorder level is. The system can also be
> able to alert on maintenance dates whereby after a certain period it alerts
> it need to be maintained. I wanted to add a functionality whereby the
> system can be able to calculate either depreciation or appreciation on the
> asset.
>
>
> On Wed, Sep 16, 2020 at 6:47 PM Akorede Habeebullah 
> wrote:
>
>> Can you be more elaborate?
>> How does the system work?
>>
>> *Akorede Habeebullah A.*
>> *hda0...@gmail.com *
>> *+2348179564316*
>>
>>
>> On Wed, Sep 16, 2020 at 4:43 PM Ernest Thuku 
>> wrote:
>>
>>> Hello guys,
>>> I have developed a system to manage assets. It is more like a stock
>>> management system whereby the system has a reorder level and such. Anyone
>>> who can help me to apply appreciation/depreciation code?
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodX3oVGzz%3Duh2JH%2BCRNeUWztQsOQX2hFi0pVQV0dZktWw%40mail.gmail.com.


Re: How to calculate appreciation in django

2020-09-16 Thread Ernest Thuku
The system is a managing system whereby you maage Items like the stock
system, this one manages assets likes furniters,computers etc. The item is
added in the system and the system can be able to offer an alert when a
certain item is below where the reorder level is. The system can also be
able to alert on maintenance dates whereby after a certain period it alerts
it need to be maintained. I wanted to add a functionality whereby the
system can be able to calculate either depreciation or appreciation on the
asset.


On Wed, Sep 16, 2020 at 6:47 PM Akorede Habeebullah 
wrote:

> Can you be more elaborate?
> How does the system work?
>
> *Akorede Habeebullah A.*
> *hda0...@gmail.com *
> *+2348179564316*
>
>
> On Wed, Sep 16, 2020 at 4:43 PM Ernest Thuku  wrote:
>
>> Hello guys,
>> I have developed a system to manage assets. It is more like a stock
>> management system whereby the system has a reorder level and such. Anyone
>> who can help me to apply appreciation/depreciation code?
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK37-gO5qosxEpK7ULb9GxCfBq4ky2MYqOf_7WkDCxQBo%2BiZBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodkFrwoKTihJzr4EY_gti7VUU604GGyXEwoBwqyeodmGQ%40mail.gmail.com.


How to calculate appreciation in django

2020-09-16 Thread Ernest Thuku
Hello guys,
I have developed a system to manage assets. It is more like a stock
management system whereby the system has a reorder level and such. Anyone
who can help me to apply appreciation/depreciation code?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuoeLeeXJx3ZGA8X8vD3t1W7CYb3xi2t9%2BLUqXpdFuHD_0Q%40mail.gmail.com.


Re: Python-django project

2020-07-20 Thread Ernest Thuku
Interested

On Tue, Jul 21, 2020, 07:45 yammuna pari  wrote:

> Hai I am interested
>
> Regards,
>
> Yamuna
>
> On Tue, Jul 21, 2020 at 11:16 AM Nagaraju Singothu <
> nagarajusingoth...@gmail.com> wrote:
>
>> Interested
>>
>> On Tue 21 Jul, 2020, 8:40 AM learn code >
>>> Hi everyone,
>>>
>>> I am learning python and django, like to work on the projects to improve
>>> more.If any one interested to join with me to work on the projects,plz send
>>> me a email.
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/e7116e9b-9458-4f49-a638-135c4b5874e0o%40googlegroups.com
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMyGuAbu-z8uDwS9KS%3Df4c7sMkgtLrM5cN4AHz6d3dM-7CVN6Q%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKTtA5ZO58xHtJhw14pUUC%3DtxHeVVDCvZ%3DCrSgpC8ZV4ARnaGw%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodEf96BcFWhVnzM%2BEkhb4D7-oYPWnJOdeiFU69BgeutBg%40mail.gmail.com.


Re: Required Django programmers for HR Portal project

2020-06-28 Thread Ernest Thuku
hello I am interested


On Sun, Jun 28, 2020 at 5:03 PM Dvs Khamele  wrote:

> Hi Maninder Kumar,
> I have built several similar HR Based solutions and few chatbots of HR all
> Django Backed.
> So, not as an intern but I am interested in joining this project or your
> company as a developer / senior developer. If that suits your needs.
> Thanks & Regards,
> Divyesh Khamele
>
> On Sun, 28 Jun 2020 at 01:27, maninder singh Kumar <
> maninder.s.ku...@gmail.com> wrote:
>
>> Dear group subscribers,
>>
>> I require Django programmers for an HR Job portal.  It is an intern
>> project.
>>
>> regards  willy
>>
>> 
>> Maninder Kumar
>> about.me/maninder.s.kumar
>> 
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CABOHK3QFjdFBhptC5YExGd%3DtO%2BmMeZzjy%3DL0u67mWRT2SihwfA%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAH9mneUh%2BoDYrC8SXPpW%3D%3DJneg-JOG1tWC5n0LgtuvO0B4JdgA%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofxj7%3DceemSjc%2BD7VyWfqir8sRGn87zwC6dM38FkDjxCQ%40mail.gmail.com.


Re: Looking for experience dgango developers to work on a Project

2020-06-25 Thread Ernest Thuku
  Hello,
I am interested in the position of a Django Developer. I have been working
with django thus have an experience. I would like to hear more about the
project.
Thank you,
Ernest Thuku

On Thu, Jun 25, 2020 at 5:55 PM BENDEV  wrote:

> Details of the project:
>
> The team of 7 developers will be building a cloud based documents
> management system.
>
> Duration of this work is 3 months.
>
> Interested and need more details about this project DM me Directly.
> (Solomontar2@gmail)
>
> Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4b3135a9-6e0d-4427-8e09-25bb5943399fo%40googlegroups.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofWUsLu0WTTXfV%3DyrmDqA5Ss9ZUDpi1Qq4i2kwG3fngrA%40mail.gmail.com.


Re: How to get Dependent Dropdown Feilds in Django ModelForms. Please answer : Important

2020-06-07 Thread Ernest Thuku
I think that you will have to use something like JavaScript in the model
forms

On Sun, Jun 7, 2020, 09:34 Sai  wrote:

> Hi guys,
> I am working on a* Django project,* which involves submission form and
> saving the data in the database using model form.  I am stuck with one of
> the functionalities of form which should work like for example "do you want
> benefit plan: *YES,* *next Field options should pop up*. if click* NO,
> nothing should happen* and move to the next question."
>
> I went through all over the internet and found the dependent drop-down
> select option but not like field pop up as we click through te form.
>
> Please let me know how to achieve this in a clear way as I am new to
> Django and programming as well.
>
> Thank You so much in advance.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0c8d8457-b2d8-4598-aa0d-b9b05e817722o%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodduYpLU%3DTVgfbWgvNe-UQTQN7PVQ_3US8hswd8vut2Mw%40mail.gmail.com.


Re:

2020-05-04 Thread Ernest Thuku
It means you have put remember password on in your browser settings..so the
information that you have registered in a form from a user will be
displayed.

On Mon, May 4, 2020, 21:53 fahad rasool  wrote:

> In my django project ,when a user sign up, a form is redirected to fill
> user information,further iam displaying this info on other page ,but whats
> happening is when i am dislaying the information of the current user who
> had logged in ,information of all users is displayed who had been signed up
> earlier.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACqgSmCraF9id7A24CX%2B1gFHnnknoskE4ZBV-LFj6se1nHfmTQ%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofX_-iKHYpa%3D5gDjxLzsGb7CcpYu8coiWvUb4piawD%2Bhg%40mail.gmail.com.


Re: i want to change database sqllite to mysql but show error

2020-04-12 Thread Ernest Thuku
May we see some of your files..precisely settings.py...and have you
properly configured your MySQL app...either workbench or xampp?
On Apr 12, 2020 20:53, "Andrew Fetting"  wrote:

> Have you tried
> pip3 install mysqlclient
>
> On Sun, Apr 12, 2020, 7:36 AM Arun Sharma 
> wrote:
>
>> python manage.py runserver
>>
>>
>>
>> Watching for file changes with StatReloader
>> Exception in thread django-main-thread:
>> Traceback (most recent call last):
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\backends\mysql\base.py", line 16, in
>> 
>> import MySQLdb as Database
>> ModuleNotFoundError: No module named 'MySQLdb'
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Arunkumar\AppData\Local\Programs\Python\Python37-32\lib\threading.py",
>> line 926, in _bootstrap_inner
>> self.run()
>>   File 
>> "C:\Users\Arunkumar\AppData\Local\Programs\Python\Python37-32\lib\threading.py",
>> line 870, in run
>> self._target(*self._args, **self._kwargs)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\utils\autoreload.py", line 53, in wrappe
>> r
>> fn(*args, **kwargs)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\core\management\commands\runserver.py",
>> line 109, in inner_run
>> autoreload.raise_last_exception()
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\utils\autoreload.py", line 76, in raise_
>> last_exception
>> raise _exception[1]
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\core\management\__init__.py", line 357,
>> in execute
>> autoreload.check_errors(django.setup)()
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\utils\autoreload.py", line 53, in wrappe
>> r
>> fn(*args, **kwargs)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\__init__.py", line 24, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\apps\registry.py", line 114, in populate
>>
>> app_config.import_models()
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\apps\config.py", line 211, in import_mod
>> els
>> self.models_module = import_module(models_module_name)
>>   File "C:\Users\Arunkumar\AppData\Local\Programs\Python\
>> Python37-32\lib\importlib\__init__.py", line 127, in import_m
>> odule
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 1006, in _gcd_import
>>   File "", line 983, in _find_and_load
>>   File "", line 967, in
>> _find_and_load_unlocked
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in
>> _call_with_frames_removed
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\project\models.py", line
>> 4, in 
>> class Project(models.Model):
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\models\base.py", line 121, in __new__
>>
>> new_class.add_to_class('_meta', Options(meta, app_label))
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\models\base.py", line 325, in add_to_
>> class
>> value.contribute_to_class(cls, name)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\models\options.py", line 208, in cont
>> ribute_to_class
>> self.db_table = truncate_name(self.db_table, connection.ops.max_name_
>> length())
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\__init__.py", line 28, in __getattr__
>>
>> return getattr(connections[DEFAULT_DB_ALIAS], item)
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\utils.py", line 207, in __getitem__
>> backend = load_backend(db['ENGINE'])
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\utils.py", line 111, in load_backend
>> return import_module('%s.base' % backend_name)
>>   File "C:\Users\Arunkumar\AppData\Local\Programs\Python\
>> Python37-32\lib\importlib\__init__.py", line 127, in import_m
>> odule
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 1006, in _gcd_import
>>   File "", line 983, in _find_and_load
>>   File "", line 967, in
>> _find_and_load_unlocked
>>   File "", line 677, in _load_unlocked
>>   File "", line 728, in exec_module
>>   File "", line 219, in
>> _call_with_frames_removed
>>   File "C:\Users\Arunkumar\PycharmProjects\app2\venv\lib\
>> site-packages\django\db\backends\mysql\base.py", line 21, in
>> 
>> ) from err
>> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
>> module.
>> Did you install mysqlclient?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> pip install mysq

Re: Django user model. 1 admin account, 1 customer account with the same email and different password

2020-04-12 Thread Ernest Thuku
Option 2 seems good...I could think of it before proceeding to any other
option
On Apr 13, 2020 04:02, "Kenny Soh"  wrote:

> Im trying to handle a use case where i have 2 roles. (admin , customer)
>
> There will be an admin portal and a customer portal (2 different login
> pages ).
>
>- An admin can invite a customer
>- An admin can be a customer as well , can invite himself into the
>customer portal
>- An admin account must not share the same password as the customer
>account.
>- Email is used as the unique field for both admin and customer
>account.
>
> For example :
>
> Admin account - custo...@email.com /password1
> Customer account - custo...@email.com /password2
>
> Solution 1: - Permission. Having 1 account with admin permission and
> customer permission. (This cant work to fit the business use case)
>
> Based on this article: https://simpleisbetterthancomplex.com/
> tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html
>
> Solution 2: - Creating 2 django projects. One for each user model since
> both accounts cant share password. The reason for separating into 2
> projects is because resources such as session,login, logout will not be
> shared. So each portal(admin,customer) has their own resource.
>
>-
>
>A create Customer API to allow admin to create a customer account in
>customer django project.
>-
>
>A shared db to share related data
>
> This is the only way i can think of to handle the use case. Please let me
> know if anyone has a better idea to handle this.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/181ec499-e36c-4009-9587-06386219ab8d%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofROv_awKgFNOiM8vYe-vHLX9a9KVwPFX-9NdSHp_f3Zw%40mail.gmail.com.


Re: TypeError: resolve() got an unexpected keyword argument 'strict' in Django

2020-04-12 Thread Ernest Thuku
Can you please provide more details...your views.. models etc
On Apr 13, 2020 01:58, "Abhishek Pandey"  wrote:

> Hello Everyone!
>
> I am a new Django learner. I followed some tutorials to install django but
> when i try to runserver an error message comes up. Whenever I hit this
> command: python manage.py runserver
> the following error comes up.
>
> Watching for file changes with StatReloader
> Performing system checks...
>
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/__init__.py", line 401, in
> execute_from_command_line
> utility.execute()
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/__init__.py", line 395, in
> execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/base.py", line 328, in
> run_from_argv
> self.execute(*args, **cmd_options)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/commands/runserver.py",
> line 60, in execute
> super().execute(*args, **options)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/base.py", line 369, in
> execute
> output = self.handle(*args, **options)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/commands/runserver.py",
> line 95, in handle
> self.run(**options)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/core/management/commands/runserver.py",
> line 102, in run
> autoreload.run_with_reloader(self.inner_run, **options)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 599, in
> run_with_reloader
> start_django(reloader, main_func, *args, **kwargs)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 584, in
> start_django
> reloader.run(django_main_thread)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 299, in run
> self.run_loop()
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 305, in run_loop
> next(ticker)
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 345, in tick
> for filepath, mtime in self.snapshot_files():
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 361, in
> snapshot_files
> for file in self.watched_files():
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 260, in
> watched_files
> yield from iter_all_python_module_files()
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 105, in
> iter_all_python_module_files
> return iter_modules_and_files(modules, frozenset(_error_files))
>   File "/Users/Abhi/PycharmProjects/SearchProject/venv/lib/
> python3.6/site-packages/django/utils/autoreload.py", line 141, in
> iter_modules_and_files
> resolved_path = path.resolve(strict=True).absolute()
> TypeError: resolve() got an unexpected keyword argument 'strict'
>
>
>
> Can anyone help me out with this, please?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/df96311a-d9ef-4dec-aca3-1b003f279c76%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofTQ2F8C%2BhymMZfXdhqiAx%2BrbBYP4rch-qHm-DKhNKV_A%40mail.gmail.com.


Re: Form not displaying

2020-03-30 Thread Ernest Thuku
There in your template...that closing form tag...is it a typing error?I
can't see the second closing tag
On Mar 30, 2020 13:23, "Ernest Thuku"  wrote:

> Try this
> On Mar 30, 2020 12:58, "Jeff Waters"  wrote:
>
>> Thanks Ernest.
>>
>> I'm not sure I follow (forgive me, I am very new to Django).
>>
>> Given that template_name is defined earlier in the method as
>> 'add_comment.html', surely what I've written is equivalent to:
>>
>> return render(request, add_comment.html, {'image': image,
>>'comments': comments,
>>'new_comment': new_comment,
>>'comment_form': comment_form})
>>
>> What should the code be instead?
>>
>> Thanks
>>
>> Jeff
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/8e5fcc67-5a91-4371-a51a-9860a6cc78e3%40googlegroups.com.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodXhoe2DXi4t3fmmSoBV1kGzS%2BpxKU5cPhC8Ux%2BHF%3D%2BFw%40mail.gmail.com.


Re: Form not displaying

2020-03-30 Thread Ernest Thuku
In the views why have you used templane_name while you not using class
based views...try and change that to render the template using request
On Mar 30, 2020 11:55, "Jeff Waters"  wrote:

> Sure. It's as follows:
>
> @login_required
> def add_comment(request, image_id):
> template_name = 'add_comment.html'
> image = get_object_or_404(Picture, id=image_id)
> comments = image.comments.filter(active=True)
> new_comment = None
> # Comment posted
> if request.method == 'POST':
> comment_form = CommentForm(data=request.POST)
> if comment_form.is_valid():
> # Create Comment object and don't save to database yet
> new_comment = comment_form.save(commit=False)
> # Assign the current post to the comment
> new_comment.post = post
> # Save the comment to the database
> new_comment.save()
> else:
> comment_form = CommentForm()
>
> return render(request, template_name, {'image': image,
>'comments': comments,
>'new_comment': new_comment,
>'comment_form': comment_form})
>
>
>
> Thanks
>
> Jeff
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/8e0f5a28-7a48-4037-aba5-ea591a81d397%40googlegroups.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofgALu7-qZFeVyxxr4LJLtAwnsFhnYvsOSD6QMBmH17bw%40mail.gmail.com.


Re: Form not displaying

2020-03-29 Thread Ernest Thuku
Can you display your views please?
On Mar 30, 2020 05:13, "Jeff Waters"  wrote:

> Apologies if I'm posting this twice - my original message isn't displayed
> in the list of messages.
>
> I am creating a website using Django. I'd like to give users the chance to
> comment on pictures they have posted. I have created a comment model and a
> comment form, and put the following code into the HTML document for the
> photo gallery:
>
> Leave a comment
> 
> {{ comment_form.as_p }}
> {% csrf_token %}
> Submit
>  However, the form is not displaying - there is nothing between 'Leave a
> comment' and the submit button on the page. I don't understand this as my
> form in forms.py appears to be configured correctly:
>
> class CommentForm(forms.ModelForm):
> body = forms.CharField(help_text="What is your comment?",
> widget=forms.TextInput(attrs={'size': '1000'}),
>required=True)
>
> class Meta:
> model = Comment
> fields = ('body',)
> def as_p(self):
> # Returns this form rendered as HTML s.
> return self._html_output(
> normal_row='%(field)s',
> error_row='%s',
> row_ender='',
> help_text_html=' %s',
> errors_on_separate_row=True)`
> So does my model in models.py:
>
> class Comment(models.Model):
> COMMENT_MAX_LENGTH = 1000
> image = models.ForeignKey(Picture, on_delete=models.CASCADE,
> related_name="comments")
> user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
> body = models.TextField(max_length=COMMENT_MAX_LENGTH)
> created_on = models.DateTimeField(auto_now_add=True)
> active = models.BooleanField(default=False)
>
> class Meta:
> ordering = ['created_on']
>
> def __str__(self):
> return 'Comment {} by {}'.format(self.body, self.user)
>
> When I go into the source code on the site, it shows that the form is
> hidden. Also, when I change comment_form.as_p to something random, no error
> messages are generated. It's like something is causing Django to skip past
> that bit of code.
>
> I'd really appreciate any suggestions anyone could please offer.
>
> Thanks
>
> Jeff
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/ac7ac525-9bc4-4043-a142-b97b1d3d0e5c%40googlegroups.com
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofTW8RywcqoK6T4SZz%2BqtkAWHHg7UAoshXOupOh6nj_WQ%40mail.gmail.com.


Re: Looking for Django developers to work on a new and an existing project with our team

2020-03-29 Thread Ernest Thuku
Hey Lax,
I am Ernest. A Django and react.js developer. It will be pleasure working
with you.
GitHub : https://github.com/Ernest-Macharia
On Mar 29, 2020 21:26, "Motaz Hejaze"  wrote:

Hi Lax ..
Ready yo join your team as soon as we reach an agreement ..

Please checkout my LinkedIn account :
https://www.linkedin.com/in/al-motaz-hejazy/


On Sun, Mar 29, 2020 at 8:00 PM Shakil Ahmmed 
wrote:

> Hello  Lax Nayak,
> I am a intermediate developer . I want to work with some team ,
> My Github : https://github.com/ShakilAhmmed
>
>
> On Sun, Mar 29, 2020 at 11:57 PM Lax Nayak  wrote:
>
>> I am looking for a django developer who has expertise in building
>> enterprise grade solutions.
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/f93f06b0-883c-4477-9d73-cc429a43380d%
>> 40googlegroups.com
>> 
>> .
>>
>
>
> --
>
> 
> Shakil Ahmmed
> about.me/shakilahmmed
> 
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CA%2BEpJfzqeLfB_4ez_cPrU_qQNgy_
> Jz0Dym6aHUQa23nahsQb_A%40mail.gmail.com
> 
> .
>
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/CAHV4E-dkzvOz22DgF%3Da2Q2%3DX1y-htP6Q_jtJZU_fHRBGP2fN1Q%
40mail.gmail.com

.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuofkfW1dPmCPFJyOoOHxUt2DqN7WDYNsRZXAkErojCLuhQ%40mail.gmail.com.


Re: how to calculate appreciation and depreciation with the use of forms

2020-03-22 Thread Ernest Thuku
Thank you so much let me go through it.


On Sun, Mar 22, 2020 at 12:58 AM Will Meyers 
wrote:

> We would need more information if you're having a specific issue, but
> general if I were building something of that sort I would be using celery
> <http://www.celeryproject.org/> to perform all the calculations.
>
> Form data can be easily serialized and passed to the task queue and the
> results can easily be retrieved. I'd start with this guide if you're new: 
> First
> Steps with Django and Celery
>
> <https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html>
>
> On Saturday, March 21, 2020 at 2:32:36 PM UTC-4, Ernest Thuku wrote:
>>
>> Hello guys am having troubles on how I will be able to perform
>> calculations in an asset management application. Is there any way I can do
>> this or anyone has ever encountered this? I will be glad for your
>> assistance.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/642c188b-796e-46d1-abb0-9421f4636982%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/642c188b-796e-46d1-abb0-9421f4636982%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuodJyiGaM%3Dnx1d7Wd937TETDaEKK%2BajUHs9_7FhdYrJi4w%40mail.gmail.com.


how to calculate appreciation and depreciation with the use of forms

2020-03-21 Thread Ernest Thuku
Hello guys am having troubles on how I will be able to perform calculations
in an asset management application. Is there any way I can do this or
anyone has ever encountered this? I will be glad for your assistance.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuoe8_efVMK6ESD%2BaF3quMcqneoiMrNxmr9v%2BEOvD_xfM2g%40mail.gmail.com.


Re: Class based views vs methods

2020-03-02 Thread Ernest Thuku
first I can advice you to learn the function based views. They will give
you a good foundation of how views work and after that switch to Class
Based Views(they are magical and easy to use).

On Tue, Mar 3, 2020 at 12:59 AM guettli 
wrote:

> The django tutorial starts with method based views.
>
> What is the state of the art?
>
> If I am unsure: Do you suggest to use class-based or method-based views?
>
> Regards,
>   Thomas
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/963bb6e7-d8e2-4987-b6c8-31cbcbfbc6a0%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPsfuof77SLhx0nAyVJjSz42VFtC4CB%2BF77iahHyv0j5VE6v7g%40mail.gmail.com.