Pradeep
okay thanks
Thara bhai mudi
Rohan
Given the cost of living in Bangalore, I won't be making a lot of difference from my current one :/
Thara bhai mudi
I know right
Thara bhai mudi
I didnt even say anything i just sent 🌚
Rohan
You should apply too BTW
Thara bhai mudi
Will
Thara bhai mudi
inchidi
Will
gl gl
Rohan
gl gl
No good luck for me senpai ?
Rohan
Rohan
Thara bhai mudi
gl gl
Yay.😎
Wang
Hello everyone
Wang
I have a question
Wang
I want to define a some model in django
Wang
I want to define a some models in django
Wang
Province City Zone
Wang
Can I use inherited?
inchidi
Can I use inherited?
which model inherited from which model?
Wang
i want zone inherited city and province
Wang
but the models is error.
inchidi
i want zone inherited city and province
looks like what you need is relationship instead inheritance
Wang
i want to by zone instance callback city name and province name
Wang
i known your mean by foreginkey
Wang
What can it do with the inheritance in Django?
Wang
i am freshman in django
Wang
can give me a example
inchidi
inchidi
What can it do with the inheritance in Django?
you are using inheritance when you want to have same fields with inherited models
Wang
i have no data, but i have some example in my head
inchidi
yes please
Wang
city is New York. zone is queen
Wang
i can by queen instance callback get city name
inchidi
then you can do: class City(models.Model): city_name = models.Charfield(...) province = models.ForeignKey(Province, ...) class Zone(models.Model): zone_name=models.Charfield(...) city = models.ForeignKey(City, ...)
Wang
look like the example city = queen.city
Wang
thanks man
Wang
yes i got it
inchidi
you can also make ..._name unique models.CharField(..., unique=True) if you dont want to have duplicate zone name
Wang
yup u are right. thanx u for ur advice
Django Bot
>> Links - Django Tips #22 Designing Better Models - Django models, encapsulation and data integrity - 😸 Date lookups in Django
Jimmies San
please help who want to help: use some snippetcode-site to share code and errors so it's more readable. check rules on pinned messages too [there are some snippet-site to help you]. thanks :)
Django Bot
>> Links - python django Automated testing part 2
Rajat
I downloaded a template online for dashboard for my project. I enclosed it in a Django Project so that I can run it by using python manage.py runserver. The problem is that the template is not loading completely
Rajat
If I run it separately, it works
Rajat
Inside Django, it does not load completely
Rajat
What shall I do?
Rajat
I've seen that we need to have all css and js files inside static folder
Rajat
But then the template is huge and I cannot shift so much of content to static folder and change all links in html files
Jimmies San
do have you configured django for manage static files? do you read the docs about it? https://docs.djangoproject.com/en/2.0/howto/static-files/
Rajat
Can I do anything else?
Jimmies San
i really suggest this lightining talk about static file: first time can be tricky but is really easy [it jump to the right second] https://youtu.be/eEZYDDaDeCs?t=1794
Rajat
Ohk. I'll watch it
Jimmies San
Jimmies San
but if you don't manage that in the right way... debugging can be a really pita [pain in the axx :P ] . so rtfm and check your configuration and all procedure is correct and then we can debug it
Jimmies San
Okay 😓
that's an hard life :)
Rajat
True 😞
Segmentation
Hi, Guys! How use middleware only for one view?
R
Hi, Guys! How use middleware only for one view?
decorator_from_middleware may be what you need
Django Bot
>> Links - Introduction — django-pipeline 1.6.13 documentation
Anonymous
How to prevent users from starting multiple accounts? Also need save tor users
Jimmies San
Jimmies San
you don't have any kind of verification? sms or something?
Anonymous
I think something like ip or Mac
Jimmies San
yes maybe like ip but that an issue if: you have a lot of mobile users - they are behind nat very often
Jimmies San
and a skilled user easily change his IP
Anonymous
Ye that’s problem
Jimmies San
yes,w ithout a verification its quit impossibile
Anonymous
As with tor
Jimmies San
yes, or you close all tor connection
Jimmies San
you can rate-limit your api/registration form to avoid a lot of registration in a short time