i frequently do an operation where i'll cycle through a bunch of XML, look to see if a matching object in the database exists, and if not, write it. If it does exist, i don't update it. im thinking get_or_create() might be less efficient than doing a qs.filter(pk=foo).exists(): check. any input on that?
lfalvarez has quit
lfalvarez joined the channel
__falcon__ joined the channel
djm- joined the channel
lfalvarez has quit
manicouman joined the channel
Guddu joined the channel
busla joined the channel
jcerise joined the channel
busla has quit
eka has quit
AimerPaddle has quit
eka joined the channel
natea joined the channel
busla joined the channel
Hairy joined the channel
Hairy joined the channel
radez has quit
juztin joined the channel
snurfery
offtopic, but
leonard nimoy passed =(
jessamynsmith
I know :(
immerser joined the channel
cewing joined the channel
AimerPaddle joined the channel
jcerise has quit
You know the dreaded "Your models have changes that are not yet reflected in a migration" message... is there a way to find out which app is causing it?
disturbedmime joined the channel
__falcon__ has quit
teebes joined the channel
SoftwareMaven joined the channel
Agent86 joined the channel
django783 joined the channel
SirRetnuh joined the channel
django783
hey I quick question about regex in URL patterns. Is there any way to register a pattern such that I don't have to keep repeating it. For example, lets say a slug has a well defined pattern I'd rather not have to keep writing the pattern that validates a slug
Hairy joined the channel
I know patterns are just strings and therefore I could use string concatenation/interpolation but I sort of imagined there might be some nice way to register a table of the common patterns I use and have the URL pattern thing know what I mean by them
does that make sense?
GabLeRoux has quit
djm- joined the channel
jgomo3 joined the channel
garrypolley
url(*args) is just a function. If you have a set of very common ones you could make your own function that wraps it and inserts the part you repeat a lot.
Broodoobob has quit
jgomo3
Hello. I'm working on the idea to make a custom widget for ForeignKeys. The idea is to substitute the <select> with a GeoLayers map.
foxhound6
jessamynsmith: not a proper solution, but maybe run makemigrations (or schemamigration) on each of the apps and find the one that doesn't say "no changes"?
django783
@garrypolley that makes sense. I was just wondering if there was a common pattern or add-on to stop me reinvinting that wheel. I know it doesn't take much inventing but it just seems like a problem everyone would have. i.e. is everyone really writing the pattern for an integer PK over and over again. It just seems like a perfect scenario for macros
Dslegends joined the channel
garrypolley
It's a pretty small thing to re-write though.
And it's nice to be able to easily read the urls.py file and know all your routes.
justinsevens joined the channel
At least that's my thought. I usually don't care about the small amount of semi-duplication.
naro has quit
_steve joined the channel
jessamynsmith
foxhound6: yes, the trick is that you need a completely clean env
I found out the hard way that even if I did pip uninstall on a package, it doesn't remove the generated migrations
DLSteve joined the channel
foxhound6
jessamynsmith: again, probably not a proper solution, how about spinning up a new virtualenv, installing your requirements list and then backing out the packages one by one until you find the offender?
jessamynsmith
foxhound6: that is essentially what I did
ohrstrom has quit
foxhound6
jessamynsmith: lol ok sorry I couldn't be of more help
jessamynsmith
someone else just asked me about the same issue, and I was wondering if there was an easier way for them to debug
the problem happens only on heroku, not local
radez joined the channel
Hairy joined the channel
_ska-fan is now known as ska-fan_
mihow has quit
aron_kexp has quit
jgomo3
So i was considering 1) to work on something like ModelChoiceField, 2) Work only on a Widget. In any case, a think one could use a ModelForm and specify its Meta.widgets attribute but also there is the option of specifying its Meta.field_classes attribute. In any case, i would apreciate some guide on wheter work on a FormField/Widget or only a Widget.
aron_kexp joined the channel
slixpk joined the channel
suchkultur joined the channel
foxhound6
jessamynsmith: what django version? 1.7 or <=1.6?
jessamynsmith
1.7
In my case it was django-allauth, and the bug is logged.
non-trivial fix, alas
I don't know if south migrations would've had the same issue, as I only started using django-allauth after I upgraded to 1.7
Nelluk has left the channel
foxhound6
jessamynsmith: I'm digging around as best I can, but to be frank you're probably a lot more experienced with django than I am
jessamynsmith
ah, thanks for looking at it
ska-fan_ has quit
immerser has quit
PranY joined the channel
PranY
can we pass multiple clean() method inside same class?
Using clean_<fieldname> it allows me to run my test but avoid 'except:' followed by my validation error
using clean() it avoids the complete method for my tests
emperorcezar joined the channel
Agent86
for list_display , short_discription and use of property() as shown in the example for 'full_name'. For a noob am I to assume that the example for use of models.Model would be in the models.py file and that admin.ModelAdmin is used in the admin.py file ?
litewait
I need to create a long running socket server connection pool. Each user will require a long running connected socket, so I want to create a socket pool manager where the individual request can pool and use a socket (to a legacy app). Is this simply a matter of creating a socket pool class that is started when django is started? Where can I hook this in during django startup.
Agent86
I have it working but wondered if this is the general assumption
so my short version of this question is this: is it generally assumed for dejango documentation references where shown models.Model that this would assume use inside of a models.py file ?
orbitalz has quit
foxhound6
jessamynsmith: try running makemigrations without specifying an app and append --dry-run to the end
django783 has quit
JvW1954 joined the channel
jessamynsmith
foxhound6: ah, that is probably the best way, thank you!