Okay, so I've tried both authenticate(email=email, password=password) and authenticate(username=email, password=password), with email being a user's email (checked the database), and authenticate is returning None
nicklo joined the channel
sivy has quit
mstrcnvs
litewait: you'll need to subclass them and implement your own dispath method
sligodave has quit
tbaxter has quit
Kye: models, models, code, views, models, give us code
forms.py is for the login form which is reporting the auth failure
digismack joined the channel
meisth0th
i have a model User with name field, how can i get all names of users as a tuple e.g?
deesah
Pretty new to web development and started building an app in Flask (thought lower barrier to entry), then I realized I needed add ons for Forms, an ORM, Session Management. Would I be better to go with Django since it looks like I need all the batteries?
mstrcnvs that's what I figured. I've used Flask for one other project and thought I would try it here. The first time it was basically to add a dashboard to some scripts I had already written. It's internal and didn't need users or sessions or anything. Seems like I need more for this one.
Thanks
lunanoko joined the channel
flax2 has quit
mstrcnvs
deesah: do you need apples or oranges?
meisth0th has quit
hyp3rkyd joined the channel
zingysaturn joined the channel
deesah
That's the problem...I didn't really know until I started. I was overthinking it and then decided just to start somewhere. Now I'm rethinking that decision.
Goopyo joined the channel
flax2 joined the channel
benregn joined the channel
Seems like Django is the better choice here though. Thanks
tylrr joined the channel
hell_razer joined the channel
Maior
deesah: I've worked lots with both; ime it's much easier to not use bits of Django that you don't need, than to bolt on bits of Flask that you do
tylrr has quit
mission joined the channel
deesah: (so I only go with Flask where I know I'll be doing something fairly minimal)
can i override a attribute of a model in model instead of just sending the data from database?
nicklo joined the channel
edvin joined the channel
joshuajonah
meisth0th: Yeah, you could temporarily override an attribute and it will stay till the render is done, but it won't stick unless you save it.
meisth0th
joshfinnie: no no, i just want to return a default value if it's None for example
rthat has quit
joshuajonah: ^
joshfinnie: sorry for highlighting
wenzhixue has quit
matclayton joined the channel
joshuajonah
meisth0th: Yeah, then that's what you'll get
flosch joined the channel
meisth0th
joshuajonah: how can i accomplish this?
joshuajonah
meisth0th: I don't understand what you want.
mmcardle joined the channel
meisth0th
I have a model User let's say, and i have a attr name. i want to display 'John Doe' when i use user.name in template if user's name field is empty.
rvankleeck joined the channel
i tried defining a method named 'name' in model and checking self.name in it, but i get infinite recursion there
joshuajonah
Well, if it's not a required field, then it will show the default. If you use an actual database default, it will put "John Doe" in the database, otherwise, you must do a boolean check for a value and display John Doe