Neo
can i msg you in inbox
Lapanit ☃️
Im kinda busy, talk to owner
Neo
who is owner sir
Lapanit ☃️
@DimasInchidi
inchidi
Neo
Neo
ok
Neo
Neo
sir i have doubt
Neo
that why this rule is made
Neo
silence makes admin
inchidi
Neo
then what is true
inchidi
know how to manage group. thats all
Neo
can anybody be an admin sir
Lapanit ☃️
only those who dont talk 🤐
inchidi
can anybody be an admin sir
i think if and only if that person trusted and will not change group configuration, add bot to spam with inappropriate content
Neo
Neo
i alway respect everyone
Neo
in all python groups
inchidi
what should i do to be
i think for now maybe be active coz you just joined to this group right?
this is offtopic lets end this convo or just pm me
Lapanit ☃️
or move to Offtopic group
Neo
Neo
done
Neo
:)
Anonymous
Anonymous
Anonymous
Anonymous
There is a serializer
Anonymous
For cookies
Anonymous
Look in django sessions docs
Django Bot
>> Jobs
- Web Back End Engineer
Tushar
can someone tell me how to add values in template
Tushar
using for loop
Abhi
{{ for object in objects }}
{{ object.attrb name }}
Tushar
no I want to add integer values
Tushar
eg
{{ for object in objects }}
{{ object.abount[0]+object.amount[amount of second]+ and so on till end }}
Anonymous
That's some bad design
Anonymous
What exactly you want to do
Tushar
i have taken the price of some items in model
Tushar
and i want to total it
Anonymous
Well, we got views for that
Anonymous
Templates aren't for that
Tushar
can you tell me how to do it in views
Anonymous
I guess you have to user ajax for that
Anonymous
If you don't wanna refresh
Anonymous
Or if refresh is fine
Tushar
refresh is fine
Anonymous
Then send a post request to a view
Anonymous
Create a view for it. Then calculate the sum and return the response with sum and the values you received
Tushar
ok
Tushar
will try it now
Val
can any one help me with a search repository with a github api?
Tushar
Anonymous
👍
Anonymous
Valentine i wrote a example for you, it works with python2 and 3
Anonymous
import json
try:
from urllib2 import urlopen
input = raw_input
except:
from urllib.request import urlopen
query = input('Query for search: ')
lang = input('Language: ')
searchURL = "https://api.github.com/search/repositories?q=%s+language:%s&sort=stars&order=desc"%(query, lang)
try:
jsonData = json.loads(urlopen(searchURL).read())
except:
jsonData = json.loads(urlopen(searchURL).read().decode())
for item in jsonData['items']:
owner = item['owner']['login']
repoName = item['name']
repoURL = item['html_url']
print("-"*20)
print("Owner : " + owner)
print("Repo Name: " + repoName)
print("Repo URL : " + repoURL)
Anonymous
http://dpaste.com/1Z94QTK
Val
Val
starting working on a school project yesterday the picture above show the task, inchidi has been awesome taking me through and been patient with me but hes busy at the moment. so far i am suppose to use a python web framework to develop a repository using github api...
Val
progress made so is 1. i got my django running...
2. created a search form in my index.html and linked it to my view.py
Val
the picture above is the view.py
Val
and this is my index.html
Val
all this resulted to this at the front end...
Val
but on meet my teacher he stated it was incorrect following the example he gave in class (p.s the man can be annoying sometimes...)
Val
the picture above is my teacher example
Val
pointing out that i used the wrong repository url in my view.py thereby not making me get my {sha}, {commit_message}
Val
can anyone help???
inchidi
can anyone help???
try this
def index(request):
if request.method == 'GET':
query = request.GET.get('query')
url = "https://api.github.com/search/repositories?per_page=5&sort=created&q="+str(query)
data = requests.get(url).json()
for repo in data["items"]:
url = "https://api.github.com/repos/"+repo["full_name"]+"/commits/master"
repo_datas = requests.get(url).json()
repo.update({'repository':repo_datas})
return render(request, 'application/index.html', {'query':query, 'data':data}
inchidi
inside for loop
{{ repo.repository.sha }} for sha
{{ repo.repository.commit.message }} for commit message
{{ repo.repository.commit.author.name }} for commit author name
inchidi
*repo is your iteration alias for each data.items
Val
Val
Django Bot
>> Blogs
- Sure Fire Way Your Forms Don't Validate
Azimbek
Hi all. I am new in django. I have question. Why does _unicode need ?
Neo
Azimbek
Thanks
Neo