Manish
I'll make a little sample project later, when I have time, to show you
do one for me on adapting custom user model in mid project. please
cj
do one for me on adapting custom user model in mid project. please
I told you... fix your project, not django...
Manish
I told you... fix your project, not django...
yes but i don't know that much sql.
Macurrent
this
What do i use as name?
Manish
What do i use as name?
Not name as content use <textarea name="content" id="editor"> <p>This is some sample content.</p> </textarea>
cj
yes but i don't know that much sql.
by fixing your project I mean: re-analyze requeriments, re-do user stories, if it's not too late, start from scratch again, make a better design
Macurrent
if request.method == 'POST': content = request.POST['content']
What do i use as name. Am seeing name.. Am gazing its a variable
Manish
What do i use as name. Am seeing name.. Am gazing its a variable
i mean recieve value from textarea with attribute name of value "content" (or whatever is in your html frontend)
Macurrent
Not name as content use <textarea name="content" id="editor"> <p>This is some sample content.</p> </textarea>
Am using autogenerated django forms.fields = ('title', 'text',). i used id_text as my id though i never defined anywhere the text id is id_text.. What about the name of the text. How will i know it?
Manish
and i don't use.
Macurrent
This is more dangerous feature of django that i don't like to use.
cj can you help here? You had a massive knowledge in autogenerated django forms. How do i identify the name of my text?
Manish
@Macurrent def __init__(self, *args, **kwargs): super(SignUpForm, self).__init__(*args, **kwargs) self.fields['content'].widget.attrs['id'] = 'editor'
Manish
no
why?
cj
why?
why would you want to override it? do you do it field by field? do you do it for all the models? it's overkill
Manish
why would you want to override it? do you do it field by field? do you do it for all the models? it's overkill
well i don't know shortest way on autogenerated fields. But for small nos. of field one can do this.
cj
well i don't know shortest way on autogenerated fields. But for small nos. of field one can do this.
I'd preffer leave them alone and use id_name in the front-end🤷🏻‍♂️
Manish
and how to do that? He is using autogenerated form field.
cj
and how to do that? He is using autogenerated form field.
id_field_name for HTML field ids field_name for HTML field names
Macurrent
id_field_name for HTML field ids field_name for HTML field names
fields = ('title', 'text',)... My id name for text here was id_text. What will the name for the text be?
cj
fields = ('title', 'text',)... My id name for text here was id_text. What will the name for the text be?
I told you... the same name as the field in the model (and in the ModelForm, because it's the same) 🤷🏻‍♂️
cj
In short. It will be called text?
it can't be other thing 🤷🏻‍♂️
Manish
Let me try this and see
This won't work with autogenerated form fields. You have to manually add htmls on page
cj
This won't work with autogenerated form fields. You have to manually add htmls on page
for autogenerated forms you don't have to manually add anyhing, that's why they are autogenerated
Anders (izzno / gooood) 🇳🇴
Still not sure about the whole "virtual" relationship thingy...
Ronald
Yes, I like it, but I've never used it with django.
Was completely separate in my case. Used Django and postgresql to help with caching and stuff from aggregated data. The mongodb was a db on its own.
Macurrent
I'll make a little sample project later, when I have time, to show you
I will be waiting for your help. I already started using your method and i think its better for me to make a thing out of it!!!
Ronald
Anders (izzno / gooood) 🇳🇴
+binary
Macurrent
Manish
You are making this sound simple
Well it is simple for admin panel.
Macurrent
You are making this sound simple
from django.db import models from ckeditor.fields import RichTextField class Post(models.Model): content = RichTextField()
Macurrent
Well it is simple for admin panel.
Or maybe yours was also a different idea?
Manish
i have used that gives errors
This won't. If import is right.
Macurrent
This won't. If import is right.
How was your idea. The cke editor doc shows i should install ckeditor. It gives so many things
Macurrent
This won't. If import is right.
https://stackoverflow.com/questions/50709813/ckeditor-configuration-in-django-admin. Also have a look at that.. I dont want to follow a procedure that will mislead me. Could you help me on a better way to do it?
Manish
https://stackoverflow.com/questions/50709813/ckeditor-configuration-in-django-admin. Also have a look at that.. I dont want to follow a procedure that will mislead me. Could you help me on a better way to do it?
Just use this from django.db import models from ckeditor.fields import RichTextField class Post(models.Model): content = RichTextField() You don't need anything else.
Manish
For custom configuration use RichTextField(config_name="my_config")
Manish
Define my_config in settings.py
Manish
Like this CKEDITOR_CONFIGS = { 'my_config': { # 'skin': 'moono', 'skin': 'office2013', 'toolbar_Basic': [ ['Source', '-', 'Bold', 'Italic'] ],}}
Manish
Macurrent
What errors?
unexpected token from
Manish
Kindly put it in a more readable manner
Use official use guide from django-ckeditor github repo
Manish
On readme you will find the code
Anders (izzno / gooood) 🇳🇴
geese louis... I dont understand why not more people use django...
Ильяс
how to write else if statements in html so it would display if pic does exist or it will pass if it is not uploaded?
🏳️‍🌈Robby [ Private Message = Spam]
Anders (izzno / gooood) 🇳🇴
Ильяс
thanks
🏳️‍🌈Robby [ Private Message = Spam]
👍
What did we learn from this experience? Google first, then ask here.
Muflone
I wonder how many times Robby tells people to use Google... 😊
Muflone
lmgtfy.com/?q=how+many+times+robbie+tells+people+to+use+google
🏳️‍🌈Robby [ Private Message = Spam]
Oleg
lmgtfy.com/?q=what+entitlement+looks+like
FIrst result: Robby O'Connor's picture
Oleg
Caption: entitlement to show people their place
🏳️‍🌈Robby [ Private Message = Spam]
Shiva
Guys anyone worked with map in Django ?
Anonymous
Hei can i use requesr.metta.httpreferer in httpresponseredirect?
🏳️‍🌈Robby [ Private Message = Spam]