Re: Hello From Nigeria

2019-03-21 Thread carl collins
Pls add me +237677104421

On Thu, Mar 21, 2019, 13:11 Gabriel Stone 
wrote:

> hello i am from Ghana am i qualified to join?
>
> On Thu, Mar 21, 2019 at 1:54 PM Asiwaju Lasisi Prodigy Olatunbosun <
> bosun...@gmail.com> wrote:
>
>> Yes 08024273381
>>
>> On Wednesday, 13 March 2019 12:44:16 UTC+1, Thaddeaus Iorbee wrote:
>>>
>>> Yes please.  0814390
>>>
>>> On Monday, March 11, 2019, Joshua Kayode  wrote:
>>>
 Greetings, if you are a django developer in Nigeria, would you consider
 joining a WhatsApp group?

 --
 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 post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b36b25cf-7e71-4e39-b2f7-700b76d1bd82%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL-5MpU8FfK_V-K2_D9%2ByhKB%2Bynq-DqjiyLfKCSVV%3D212kRpmg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0byZFbF7w3dBFpQK2GLvUazz-A-ppWFfY6VH7yreymXt8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Performing SQL queries on SQLite database

2019-03-23 Thread carl collins
Hello guys,
I'm Carl Collins from Cameroon. I'm working on this Django Project and I
got stuck . Need help.The first thing I   would love to ask is about
performing SQL queries in Django use Django ORM. Presume I have something
like this:

connection = sqlite.connect('data.db')
cursor = connection.cursor()

query = "SELECT * FROM items"
result = cursor.execute(query)

properties = []
for row in result:
items.append({})

connection.close()
print(json.dumps({'properties': properties})



I would love Django to run this automatically i.e fetch some field from the
database each time a button is clicked  and do a post request to an API
using the json returned as the body of the request

NB: The data in the database is populated using a django form and I would
love to use the same data to do a post request to an api. The API requires
that the post body be in json format like

{
"currency": "",
"customerName": "",
"description": "",
"email": "",
"expiryDate": "",
"id": {
"uuid": "",
"version": ""
},
"items": [
{
"itemId": "",
"particulars": "",
"quantity": x,
"subTotal": y,
"unitCost": z
},
{
"itemId": " ",
"particulars": " ",
"quantity": j,
"subTotal": k,
"unitCost": l
}
],
"langKey": "en",
"merchantReference": " ",
"orderDate": " ",
"phoneNumber": " ",
"receiptUrl": " ",
"totalAmount": n
}


Thanks in advance
Cheers
Carl

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0bzdAqMqtXYR4vgjVR%3D_PzJ3RPdAzO19KLyszwbs_PrkvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Performing SQL queries on SQLite database

2019-03-25 Thread carl collins
Hello,
 Please I need advice on how I can go on with this.
Thanks

On Sat, Mar 23, 2019 at 8:26 PM carl collins 
wrote:

> Hello guys,
> I'm Carl Collins from Cameroon. I'm working on this Django Project and I
> got stuck . Need help.The first thing I   would love to ask is about
> performing SQL queries in Django use Django ORM. Presume I have something
> like this:
>
> connection = sqlite.connect('data.db')
> cursor = connection.cursor()
>
> query = "SELECT * FROM items"
> result = cursor.execute(query)
>
> properties = []
> for row in result:
> items.append({})
>
> connection.close()
> print(json.dumps({'properties': properties})
>
>
>
> I would love Django to run this automatically i.e fetch some field from
> the database each time a button is clicked  and do a post request to an API
> using the json returned as the body of the request
>
> NB: The data in the database is populated using a django form and I would
> love to use the same data to do a post request to an api. The API requires
> that the post body be in json format like
>
> {
> "currency": "",
> "customerName": "",
> "description": "",
> "email": "",
> "expiryDate": "",
> "id": {
> "uuid": "",
> "version": ""
> },
> "items": [
> {
> "itemId": "",
> "particulars": "",
> "quantity": x,
> "subTotal": y,
> "unitCost": z
> },
> {
> "itemId": " ",
> "particulars": " ",
> "quantity": j,
> "subTotal": k,
> "unitCost": l
> }
> ],
> "langKey": "en",
> "merchantReference": " ",
> "orderDate": " ",
> "phoneNumber": " ",
> "receiptUrl": " ",
> "totalAmount": n
> }
>
>
> Thanks in advance
> Cheers
> Carl
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0by6ejQ-8t%3D1obj0nLW-8YXTRj8JfaYksz08i7qfr-H2HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Python Client generated from swagger

2019-03-28 Thread carl collins
Hello, I would love to know if any one here has ever generated python
client code using swagger codegenand used that client code  with
python/Django script or application  to  do get and post data to the  API .

I have generated a python client with swagger codegen but I don't know how
to use it to do request to my API.
Even tried googling but found nothing relevant online on how to use the
client generated to consume my API. Please someone help!


Kind Regards
Carl Collins

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0bxPMWF%3D-R5%2BNPeVRUQa8pPhWoSsV8Z%3DoRedi3f0OfBiXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Implementing a django cart using Django cart module Error: unhashable type dict

2018-09-04 Thread carl collins
from django.template import loader
from django.http import HttpResponse
from django.template.loader import render_to_string
import django.template.loader
# Create your views here.

# Create your views here.

from cart.cart import Cart
from .models import Product
'''from cart.models import Category, Product'''


#gallerydefault view
def index(request):
#prepare the models
#empty
#prepare the template
template = loader.get_template('templates/cart.html', 
dict(cart=Cart(request))  )
#prepare the context
context = {'request':request}
return HttpResponse(template.render(context, request))

def add_to_cart(request, product_id, quantity):
product = Product.objects.get(id=product_id)
cart = Cart(request)
cart.add(product, product.unit_price, quantity)

def remove_from_cart(request, product_id):
product = Product.objects.get(id=product_id)
cart = Cart(request)
cart.remove(product)


def get_cart(request):


template = loader.get_template('templates/cart.html', dict(cart = 
Cart(request))) 

#prepare the context
context = {'request':request}
return HttpResponse(template.render(context, request))
return HttpResponse(template.render(context, request))

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2a596660-1cc6-46df-a3a6-465a7ff910f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trying to build a cart using django cart. "" error unhashable type dict ""

2018-09-04 Thread carl collins
Here is the code for view.py in my cart app  please help(also see the 
screenshot):  


from django.template import loader
from django.http import HttpResponse
from django.template.loader import render_to_string
import django.template.loader


from cart.cart import Cart
from .models import Product
'''from cart.models import Category, Product'''


#gallerydefault view
def index(request):
#prepare the models
#empty
#prepare the template
template = loader.get_template('templates/cart.html', 
dict(cart=Cart(request))  )
#prepare the context
context = {'request':request}
return HttpResponse(template.render(context, request))

def add_to_cart(request, product_id, quantity):
product = Product.objects.get(id=product_id)
cart = Cart(request)
cart.add(product, product.unit_price, quantity)

def remove_from_cart(request, product_id):
product = Product.objects.get(id=product_id)
cart = Cart(request)
cart.remove(product)


def get_cart(request):
   
template = loader.get_template('templates/cart.html', dict(cart = 
Cart(request))) 

#prepare the context
context = {'request':request}
return HttpResponse(template.render(context, request))
return HttpResponse(template.render(context, request))

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a78552f7-9973-456d-b0d5-79602f4bbf5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a django cart using Django cart module Error: unhashable type dict

2018-09-04 Thread carl collins
Thanks Gopal

On Tue, Sep 4, 2018 at 4:12 PM  wrote:

> Dear Carl,
>>
>
>   I'm sorry, I've no idea what the Cart is. I'm assuming that it is a
> class which can be instantiated with some dictionary data.
>   So you try passing request.data instead of just request to the Cart.
>
> Try to check by printing request.data, it'll be a dict.
> FYI you can check the below link, may be you can find the Root cause for
> your error.
>
> https://alysivji.github.io/quick-hit-hashable-dict-keys.html
>
> Thanks,
> Gopal
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc1db1cf-b36f-434c-95b1-df82f631dd38%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0bzOAdz5cDVsY7H9WwiSaapPH1he03Ageq_mObO3oUHtXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: beginner guide

2018-10-08 Thread carl collins
Follow this awesome tutorial>
https://docs.djangoproject.com/en/2.1/intro/tutorial01/

On Mon, Oct 8, 2018 at 5:39 PM Ashok Reddy 
wrote:

> hello every one .i am beginner to Django. Could you please suggest me the
> best source to learn,i am very enthusiastic to learn.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/77c1a5fa-47ae-4708-98ad-631b75775422%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPm0byq8Z0uAnLutbyV1OsZaCdAwEo7arD1QH92K_XEDiFLEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.