eb0t, why don't you render fields always with that for loop
?
eb0t
GinFuyou: when the form is initally sent as a GET request. if i used the for loop then because the fields are manually constructed, then i'm not sure it would work
if i removed the manual field declarations
Kangermu joined the channel
Rocklayth joined the channel
GinFuyou
what do you mean "manually constructed"
RCStef has quit
They are declared in form class?
Rocklayth
Hello guys. I would like to check if a ManyToManyField is empty in a clean() of the class itself? How do i do it? When I try to access this variable, I get a "needs to have a value for field "id" before this many-to-many relationship can be used."
eb0t
yes they are declared in the form class, but the main reason i have done it this way is that eventually i want to apply some css to the field boxes and the error messages
kristian_ has quit
cryptopian joined the channel
n0nam3 joined the channel
and if i use {{form}} variable to get the fields on the html form
i was finding it difficult to manipulate the css on the fields
this way i can use my own classes
GinFuyou
you can set classes on the widget attrs instead of css
kristian_ joined the channel
if you want classes on container elements, I'd suggest rendering fields through django-sniplates widgets
Fully manual rendering is double royal PITA ^__^"
eb0t
ah .. now i have this kind of working, im going to try and implement the same thing with sniplates.
sunil_bansal joined the channel
i have the documentation, just got to see how it does things, as it seems sniplates is going to be the final method
once i suss it out
GinFuyou
sure, good luck
jeffspeff joined the channel
eb0t
thanks
pjs joined the channel
zothix joined the channel
i was avoiding the forms and templates for forms, as i just knew it would be very confusing for me, but slowly getting a feel for it , from total disaster, currently at ...a bit of a disaster.
so thats progress
GinFuyou
I totally hated dealing with forms when I started with django. Well... a while after that too >_<"
zothix
does anyone know any 1 to 1 private chat module which shows Online, offline, is typing etc
which i can use in my already existing project
GinFuyou
zothix, it's not most trivial
zothix
as in?
i should write my own chat module ?
waldhar joined the channel
GinFuyou
As in there are most likely such modules, but they may require django-channels or some other additional setup of your server
hop
Rocklayth: if you have no id on an object (i.e. it's not saved), it can't be in a relationship
adsworth has quit
GinFuyou
since django by default is not fitted by that kind of async communications
zeus1 joined the channel
hop
Rocklayth: what would be in the fk on the other end?
zothix
GinFuyou, what is the best aproach here, i need my web to have chat n all.
how should i proceed.
bradfordli123 joined the channel
GinFuyou
Django-channels is often mentioned along with chat I think, folks here would know a better advice for you
bradfordli123 has quit
Just warned you it may not be ass easy ass pip install something
zothix
the last module i was working with used sockets n stuff
but it didnt work
and it didnt gave any error either
GinFuyou
*as (sorry)
greg_f has quit
bradfordli123 joined the channel
zothix
GinFuyou, xD yes i know that xD
ass seemed to fit better though
xD
chronos joined the channel
greg_f joined the channel
GinFuyou
Shouldn't have kept that danbooru tab opened #^_^#