so I have an Article() model. I create an instance article = Article(title = ..., ...) then I want to check if it exists "if article in Article.objects.all()" but that's not very efficient. Do I have to use filter? get_or_create perhaps
FunkyBob
depends on how you define "exists"... but get_or_create is a common pattern for that
sedeki
get or create returns if it's created as well
good
amigo joined the channel
immerser joined the channel
metasandwich
hey guys
just wanted to ask
how did you guys pick up django?
pajinek joined the channel
calvinx_ joined the channel
glosoli joined the channel
calvinx has quit
calvinx_ is now known as calvinx
Nizumzen
metasandwich: just by reading the tutorial and the documentation
and practice of course
mkad joined the channel
mkad
HI
gasbakid joined the channel
Nizumzen
hi
mkad
what is the difference between flask and django?
dali joined the channel
dali has quit
metasandwich
Nizumzen
Nizumzen:haha ok
oxum joined the channel
valgrind joined the channel
I'm having a hell of a time trying to create a new poll in the "django first app tutorial"
dodobas
mipo: word flask has 5 letters and django 6... :)
Nizumzen
mkad: flask is a more lightweight web framework where as django provides much more from which you can work with - generally speaking I tend to think of flask as being a good tool for web service APIs and django is a better tool for general purpose web development but maybe that is just me
opalepatrick joined the channel
bootandy joined the channel
dodobas
flask apps will eventually include 3rd party modules that will make them 'bloated' as django
quetzakubica has quit
django apps will eventually start removing 3rd pary modules that ill make them 'lean' as flask
so are you a 'half-full' or 'half-empty' kinda person
genomespam joined the channel
FunkyBob
metasandwich: what sort of trouble?
dodobas: heh.. you want to see a lightweight web framework? take a look at antfarm :P
gasbakid has quit
metasandwich
FunkyBob: i used to use PHP so a lot of these terms are new to me
dodobas
FunkyBob: did you forget about wsgiref ? :)
metasandwich
trying to find out what forms vs formsets are now
zkanda joined the channel
FunkyBob
metasandwich: a Form is a class for casting and validating data
metasandwich: a Formset is a set of forms ... multiple forms of the same type
dodobas
metasandwich: utilites that facilitate form and formset creation :)
metasandwich
ahh okay
what does casting data mean?
FunkyBob
metasandwich: well, all data submitted in a HTML form are strings
metasandwich: you want to cast them to more useful types, like integers, or floats, or objects...
metasandwich
so its like converting the data type?
FunkyBob
yes
this is a term used in PHP also,, I'm sure
it's a fairly generic programming term
cottons joined the channel
metasandwich
oh okay
im still a novice
waiting for the day the code in the tutorial doesnt seem like pure magic
FunkyBob
heh
phaer joined the channel
ojh has quit
mipo
dodobas: :D
immerser has quit
dodobas: flask in lightweight that django , because it is 5 chars and django is 6 :D
m8 joined the channel
FunkyBob
mipo: oh shit, maybe I should rename antfarm :P
calvinx has quit
fllr joined the channel
the_rat joined the channel
hubx joined the channel
mipo
FunkyBob: :)
dodobas
FunkyBob: i can't find anything relevant about antfarm :/
breadfruitman has quit
Nizumzen has quit
JustSighDudes
How do I convert a unicode string from \u3423 to readable text? It gets rendered as the former in my templates.
FunkyBob
dodobas: hey, I only just created the repo today
JustSighDudes
Maybe I should just pay everyone to move to python 3