Шукур
Who can help me with project?
🇮🇳
What i do, it's no t runing
Shiva
<div class "intro background" style="background-image:url{% static '(images/intro.png)' %"></div> Guys I am getting error on this line
Shiva
Don't use parenthesis
Still getting error
Mirco
You need to use parenthesis before using static {% static etc... %} goes into parenthesis
Mirco
Yes now solved
😊😊
cj
😊😊
you're a magician
Aadhi
Guys , one doubt I have a set of values in a dictionary And I need to send these values into JavaScript to draw a pie chart. The problem is I need assign values from the dictionary to different variables in JavaScript
cj
or and endpoint and use AJAX
Aadhi
Okay. I will try Thank you
raven
thing was that i was evaluating value inside model for multiselectfield
raven
like problem_statement = tuple(ModelName.objects.values_list('statement'))
raven
now i know the main issue and i have a part of solution
raven
like I'm loading that field in forms and evaluating it inside init so that every time a request comes in it will fetch
raven
dunder init *
raven
problem which I'm facing right now is that I'm unable to access that variable
raven
which is inside init
raven
dunder init * sorry that tele is formatting double under score
Mirco
dunder init * sorry that tele is formatting double under score
If u use monospace option , you can write it 😊
raven
__init__
raven
oh thanks sir
Mirco
Anyway , share your code with pastebin or similar to help us understand your issues
raven
def init(self, instance, *args, kwargs): super().__init__(*args, kwargs) CHOICES = tuple(Company.objects.values_list('company_id','company_name')) # outside of __init__ company_list = MultiSelectFormField(choice=CHOICES) # Getting error Choices undefined
Sumit
Can someone please help me with sqlite? I have date in three integer columns, one got year, another got month and another got day. I want to print date from these columns into a select statement. Please help
Muflone
Just create a model and access using the ORM
Jagat
Hi I want to create 2 user like 1st user student . 2nd user parents Please guide me
Jagat
I created student user using User model Problem is in parents model
Jagat
What should I use to create parent model?
Jagat
Can u send any link to see how to do
Jagat
Please share any link for reference.
Mirco
Please share any link for reference.
https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html
Jagat
Thanks Mirco
Mirco
Thanks Mirco
Yw 😊
Sirius
Hello eberybody! my search form isn't working. When I input any query, it goes into my search template, but can't find the query.
H
Django Angular elasticsearch who did this before?
$whoami
Hi !, Is there any way I can have a piece of information accessible both in the template and in the views? I have read the context but I do not really know how to apply it, they will have some examples that they have done to guide me
$whoami
I have the User table related to a Company table, I want to have that information accessible, all the companies related to the user that I started session, there is some way to do this, sorry I'm starting in django
Marlysson
Hi !, Is there any way I can have a piece of information accessible both in the template and in the views? I have read the context but I do not really know how to apply it, they will have some examples that they have done to guide me
Context processors are functions that return common data by dictionaries. Do you have to create a function returning a dictionary with your data and point the function to key "context_processors" on TEMPLATES constant on your settings.py def companies(request): return {"companies" : Company.objects.filter(user=request.user)} TEMPLATE = [ 'context_processors':'your_app.location_your_function.companies.py' ] Here are the reference: https://docs.djangoproject.com/en/2.2/ref/templates/api/#writing-your-own-context-processors
Anonymous
how to run def functions ?
Anonymous
in templates
Marlysson
Anonymous
Using django channels for chat app is lil bit hard for me any easy ways to integrate chat room for existing django project.
Anonymous
Like custom tags?
yes how to run them any idea ?
Firoj
Which is best approach class based view or function based views or Does it depend on the project requirements
Bedilbek
in templates
template is for rendering with given kwargs, it is not for calling functions, do all the complex functional job outside the template and just give the kwags to template
Anonymous
how to receive the text entered in the temaplate in to a function
Bedilbek
with post or put method, create a form inside a template and put a submit button with specific method (PUT, POST, PATCH)
Anonymous
Can anyone help we with frontend of a html page?
Anonymous
Its problem with CSS
Mirco
how to receive the text entered in the temaplate in to a function
I think you need to study again how Django and MVC/T pattern works
Mirco
Can anyone help we with frontend of a html page?
Are u working with Django or simple frontend issue ?
Mirco
Django frontend issue
Explain better to avoid xy problems
Anonymous
Just a simple Django template html issue😅
Anonymous
mynewbot001.herokuapp.com That's my bot
Anonymous
As you can see the stars generated by JavaScript are at the bottom of page
Anonymous
With <canvas> tag
Anonymous
Inspect the page
Anonymous
And I want stars to whole page
Mirco
And I want stars to whole page
I see the stars around the whole page
Anonymous
I see the stars around the whole page
They are not near the form
Anonymous
They are below it
Mirco
gotcha but we are offtopic here , you just need to have a look again how to position element in css and how z-index works 😊
Anonymous
Do you know that?
Anonymous
Ok I will look at this😀
Mirco
Ok I will look at this😀
and you can use canvas as background, so go check it 😊
Anonymous
Ok
Mirco
Ok
the fastest fix is to give a position absolute also to your container and set z-index for it and for canvas 😊