Teutranian
problem was python manage.py shell is diffrent than django-admin shell
Teutranian
Mr. COwO2 Preis
Teutranian
what is the error?
Mr. COwO2 Preis
what is the error?
i have solved it now without the update method:
https://www.vhinandrich.com/blog/saving-foreign-key-id-django-rest-framework-serializer
worth to be noticed: this doesn't work if you use primarykeyrelatedfield instead of integerfield, wich was my first attempt
isa
Teutranian
no idea of rest , it seemed to be a python error but it's ok if it's not
Devo
Hai all I'm new to django , I know react js , a little and I want to learn django . To pursue career in full stack web development.. please guide me with best django beginner's material.. devop tools to deploy and maintain the web app.. please it will very help ful for me
Fred
Somebody will say read the docs
But that did not help me tho
Fred
Just start with some YouTube videos and proceed with projects
Fred
Can y’all please show off some projects you have developed with Django
Ice
Anyone runs his django with litespeed?
Atkhamov
Could you, please, send the link to me too?
@l3j@ndr0
Hello anyone have an example of the use of paypal and other platforms with django oscar
Mirco
Doragonsureiyā
Hello anyone have an example of the use of paypal and other platforms with django oscar
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z"
Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high.
How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Doragonsureiyā
Anyone runs his django with litespeed?
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z"
Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high.
How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Luis
hi. if I create a form from django forms, and I put a field mykey on it on a function view, how do I access the data in mykey?
Luis
i thought it was with form.cleaned_data["mykey"] but it returns blank
Mirco
Share the code via pastebin
Mr. COwO2 Preis
Current Models:
Model Company:
- id
- name
- owner (ForeignKeyField(User))
Model User (buildin):
- id
- username
- email
What I want to add:
Relation: 1 Company <-> n Users:
- 1 company has many users
- 1 user has only 1 company
I can add models.ManyToManyField(User) to the Company Model, but this results into a many to many relation. I can't add a ForeignKeyField(Company) to user, because first it's a buildin class, and second there would be cyclic dependencies because of the owner field.
How can i implement this relation?
Mirco
Mr. COwO2 Preis
The foreign key inside Company is ok
the foreign key inside company is for the ownership of the company, not the membership of members.
there should be 2 relations: membership and ownership
Mirco
Mirco
https://pastebin.com/aH8h3hAW
The if "urls" has no sense, I don't see any line where you put that key inside session
It will be always False
Luis
Mirco
Line 15 of pastebin, the if block will be always False
You do never set urls key inside session
Luis
Luis
Luis
i mean if i create a session variable in a function and then try to access it on another function, will it be available?
Luis
or do I have to pass it on render?
Mirco
Mirco
Luis
Yup, in every view
I think my problem is I'm trying to do everything on the same page, and I probably should have 3 pages instead of 2
Luis
i want to display a form on index
Luis
when someone gets there it will be a GET, but if someone submits, it will be a POST
Luis
so it makes no sense to check for POST in the GET page, I think
Luis
I mean in the first page
Anonymous
How to access current user details in class based views??
Anonymous
Anonymous
with request.user u can get the details
Anonymous
I'm use query_set but im unable to get detail in template
Sharayu
I am creating a ToDo list where I want to add Topics and the tasks under the topics. How can I do that? I just have started Django and Python. Any help would be highly appreciated!
Anonymous
Sharayu
I already have made the simple ToDo app. I wanna add another feature i.e of adding different topics and tasks under that topic.
Sharayu
Exa.
Morning
- Drink Tea
- Run 1KM
Afternoon
- Meeting at Cafe
- Visit School
Jatin
I think you can create categories like Morning, afternoon, evening
Sharayu
But it'd depend on user like what topics they want to add. It may vary. Like I wanna add as "Office", "Home" and then Tasks under it.
Jatin
Then you can allow user to create a dynamic categories
Jatin
Another option is using tags
Sharayu
Can you share any link for the same? I am new to Django as well as python. Thank you!
RENGANATHAN
i got a TypeError at django what can i do
Sam
You'll have to explain your problem better to get any help
RENGANATHAN
I got a os path error in my IDE
Sarwar
Can anyone suggest me project book of djago 3
Rotana
Dear all please help,
Can i set default value on model form had relationship model?
______________________________________________________
class Category(models.Model):
cats = models.CharField(max_length=255)
______________________________________________________
class Issues(models.Model):
issue_cats = models.ForeignKey(Category, on_delete=models.CASCADE)
_______________________________________________________
class IssueFormFault(forms.ModelForm):
class Meta:
model = Issues
fields = (
'issue_cats',
)
widgets = {
'issue_cats': forms.CharField(attrs={'class': 'form-control'}),
}
Jatin
There is a default_value field available in django models
Rotana
how could i do on it ? when i wanna update Category i need relationship to auto update on Issues but can not set default value. any way brother ?
Jatin
Anonymous
Hello everyone! I'm sorry to bother anyone, I have been away for sometime and I believe have missed a lot from the group someone should please carry along
Rotana
Rotana
just want set one of them to default.
Jatin
No idea bro
Rotana
No idea bro
yes thank for your help i will research more about this.
5P34R
hello all
5P34R
Im stucked with an django invoice project
5P34R
where i cant include multiple models for rendersing datas beased on catagory
5P34R
please any help to find a solution
Teutranian
Like what? Explain more
$iductive
Can anyone suggest me a best hosting service for django app, I want shared hosting/vps hosting preferably cheap one. Can't afford aws/gcp/digitalocean right now. I googled it but it was pretty much confusing.
Amr
Maz
Randy
5P34R
Like what? Explain more
in the invoice app i wanted to include all models like a catagory
eg: in bill if i select fish Then i ender the code I will get all kind of details like this fish need to get all models invoice app