free blog   apache   shopping directory   php powered
gasulldjszapi: I don't know about django-piston, but if you export to JSON you will be able to put it back in any DB.
djszapiwhat's the problem with south ?
tiglionabbithow do I run a python script in the django environment?
apollo13django has no environment?!
apollo13al you need todo
apollo13is set DJANGO_SETTINGS_MODULE correctly
gasullAfter fixing several problems I'm back to my original one: I'm adding a new application to my project but syncdb isn't adding it.  It's in my apps directory and it's in INSTALLED_APPS.  What am I missing?  Thank you.
Powerplayguys anybody familiar with haystack / whoosh? Just installed it and it works fine. Though i want to use the code from the search template in another template but the tags {{ form.as_table }} fails to display
gasullhow do you add django_extensions to INSTALLED_APPS in settings_local
ericholschergasull, INSTALLED_APPS += ('django_extensions')
gasullericholscher:  NameError: name 'INSTALLED_APPS' is not defined
ericholschergasull, you need to import it
ericholschergasull, there should be blog posts showing how to do this
gasullericholscher:  I'm using the method explain in the Django wiki
gasullericholscher:  I have this at the end of my
gasullericholscher:  So I cannot import settings from settings_local because there would be an import loop
ericholschergasull, with that approach you can only override the previous settings
gasullericholscher:  I got it from here:  Do you advise any other approach?
gasullericholscher:  How do you split the settings?
PhreeStylehave a question about legacy db integration. My db has almost every table's primary key mapped to a varchar field, yet it also had autoincrement fields for every table and all the tables refer to each other with the varchar primary keys, not the autoincrement field. Django won't let me set models up to use the varchar primary fields, so I told it that the auto increment fields were the primary keys. How would I go about defining t
^robertjis ther a way to register more than one ModelAdmin per model?
sakowhich package had shell_plus
gasullsako: django_extensions
andre_plwhen defining a field for use in a modelform, where is the code which actually puts the database value into the field when the form is bound?
andre_pli have defined a custom ModelChoiceField which when given an integer, uses a strange convoluted means of finding the correct model instance (its not the PK) when saving a new modelform with this, it looks it up correctly and populates the ForeignKey Field in the model with the correct PK (not the value the user entered), but when using the modelformset giving it a queryset which it uses to populate the forms, it is putting the value in
somedavidi created a function that checks if a form field has certain illegal characters, is there a way to add that to all my form fields without having to define a bunch of clean_<field> methods
somedavidideally, i would just be able to pass a variables with the field definition that lists the illegal characters for that field
somedavidand be able to define a custom error message using the same error_messages
obanhow can i get the filename of an uploaded image from a form?
obani have  image = request.FILES['image']
obanname = image['filename']  raises an error
oban'InMemoryUploadedFile' object is unsubscriptable
digilordWhen using a model that is based on a ContentType model how do you do a filter?
obanoh it's
digilordDoes anyone work with ContentType models?
nemithwhat the recommend way of doing a rest api?  Anyone have a favorite app?
EntityRebornErm, is this right? page = Wikipage.objects.get(cleantitle=title, id=pid)
EntityReborni want BOTH fields to match
digilordEntityReborn: Yeah that would do it
EntityRebornWell, apparently it's not working.
EntityRebornin my app, I am using urls such as http://localhost/wiki/edit/Who_are_we_:3/ where Who_are_we_ is the sanitised title, and 3 is the DB id.
EntityRebornRight now, I can change 3 to any number, and it shows the same page.
digilordI don't think a : is valid in a URL
EntityReborngood point.
digilord http://localhost/wiki/edit/Who_are_we_/3/ is prob what you want
nemithyou can use ;
EntityRebornI'll change that :P
digilordBAH!  I am so bloody close!
EntityReborn<digilord>  http://localhost/wiki/edit/Who_are_we_/3/ is prob what you want
EntityRebornthats exactly what I'm going to do
phretoris ubernostrum around?
phretorI am looking for someone to discuss Chapter 11 of Practical Django Projects and, in general, about how to maintain, deploy django-powered websites in painless way.
grokeni'm trying to use has_changed() on a form to see if the initial data that was provided to the form has been modified and should be saved again but it appears that has_changed() is always true if the form is not empty. my view is here:
lastkwich the best and more easy webserver to use with django? the server inclused himself dont work for access of another Ip
digilordlastk: I use Apache with Django
EntityRebornK, I have a link in my template, <a href='{{ page.editurl }}'>Edit this page</a>. in my model I have said function, editurl(self) that contains return "/wiki/edit/" + self.cleantitle + "/" + + "/". Yet, when said template is rendered, the url is not what editurl returns
lastkdigilord : there is conflit with apache+php? another thing.. using apache I need extra config for serve static files?
EntityRebornlastk, the docs mention serving static content fairly clearly
digilordlastk: I have PHP on the same server with no ill effects. is what I used to setup Apache
EntityRebornlook up deployment
saikatcif i have a standalone python script that runs as a daemon, do I need to manually cleanup objects that access my database using django?  I've been noticing that my program is leaking memory, but if i just remove areas where i update database rows, the leaks go away.
saikatcor at least, the leaks get lesser
lastkEntityReborn : I'm reading it now
pax-I'm using letting users submit content using tinymce, it outputs html, is there a good way of makeing sure only "safe" html tags gets written in the template? I don't want to use |safe
nemithyou can probably call the same "safe" method on your models save method
lastkdigilord : I was thinking in use a lighthttp instead apache, is more 'light' lol, but apache is good too
pax-nemith: what?
pax-nemith: that won't stop users submitting bad html code?
EntityRebornany ideas into the problem I mentioned?
nemithfrom django.utils.safestring import mark_safe
nemithpax-: no it won't
ahjohthi, anyone know if it's possible to sort an InlineAdmin by a certain column?
ahjohtdon't think the internal class has a parameter for this
etherealanyone? here have an opinion on dream host?
phretorhow do you manage to install applications that do not provide ?
digilordI have  I have tried a number of things and can't seem to get the filter to be built.  I know the code as it stands doesn't work unless I hardcode in the filter.  Can anyone help me?
pax-nemith: so, do you understand my problem? i want to specify what which html tags that the template should write as html and which it should escape
etherealsay phretor install where?
etherealphretor install where?
etherealhow embarrassing
phretorethereal: I mean, how do you work on Django apps/sites in general?
pax-ethereal: sudo python install
etherealcan you do that with dreamhost
pax-have you got root access?
phretorpax-: that's not easily reproducible and will require a lot of deployment efforts.
etherealwhere should i host then?
etherealwebfaction seems nice
etherealbut its in the uk
etherealwrong continent
phretorvirtualenv + pip would be lot better - I am trying to find a good combination of hg + virutalenv + pip + fabric to manage it all automatically.
obscureethereal: webfaction has servers throughout the US as well.
etherealeasy install replacement
phretorhg to version the code, virtualenv to create self-contained and reproducible environments, pip to install packages in a clean way, fabric to deploy remotely.
obscureI have a webfaction account too, dreamhost pretty much sucked for me.
phretorpip is awesome:
phretorobscure: webfaction is great imho
etherealive never heard a bad review of webfaction, how is this possible?
phretorethereal: they are very good indeed.
etherealso your using fabric to automate your deployments
etherealwhat does that have over doing raw file operations?
phretorethereal: not yet, because I haven't found a good way to layout my django applications. Note that I am trying to move towards a project-less development. I.e., a django project is actually an application.
phretorethereal: I found the ubernostrum book's Chapter 11 illuminating about this.
etherealoh, so everything will be an app under one django instance
ethereali was thinking about that
phretorethereal: no, say that you are about to create a site with django.
etherealsay phretor and then...
etherealphretor and then...
phretorthen you create a virtualenv, you pip-install your requirements and then you create one app per piece of your site. Then each of those apps are installed as requirements into your virtualenv and so forth...
lastkhey, I'm trying to configure the django with lighttpd and I have a question: "   "socket" => "/home/user/mysite.sock", " this file should be changed to my project dir?
JohnnyLwhile trying ### render_to_response("index.html", {'clients': Client.objects.get referrer__iexact=request.user.get_profile().referrer)})  ###i get:  Exception Value: (1054, "Unknown column 'credit_borobeatsiteprofilerecord.referrer_id' in 'field list'")   Where does the extra _id come from?
mattmccIt's the field that holds the FK reference in your model.
mattmccSo, since it's missing, your table and model are probably out of sync.
JohnnyLFKs *have* to end in _id?
mattmccNo, that's just the default behavior.
mattmccIt's a very old DB design practice.
JohnnyLI feel like Marcellus Wallace after he gets raped... Nah man.. there ain't no more django.db.models.Q and you. And if you _id me, you stay gone.. or.. you be gone.. DEAL?
grokenhow do i set the initial data on a bound form so that has_changed tells me if the form data is different that the initial values?
pjsclassic scene in a great movie
mattmccYou're being more absurd than usual.
JohnnyLI can't wait until SQL gets back in style.
mattmccDon't hold your breath.
mattmccThe next step for DBs will be non-relational storage, which SQL isn't any use for.
mattmccBesides, even when it was 'in style' SQL still sucked.
JohnnyLmattmcc thats where we agree to disagree.
mattmccIn any case, nothing stops you from doing all your DB interaction with raw SQL in Django.
mattmcc1.2 will even make it easier with raw()
JohnnyLthats good.
JohnnyLhappy happy!
pax-I need to modify data that users are saving, is a custom save() method or the pre/post_save signal the way to go?
pax-I was thinking either of these, but run into problems with both:
pax-erm, line 5 and 6 should be self. and not id.
EntityRebornI'm getting <bound method Wikipage.url of <Wikipage: sstest>> in my urls
EntityRebornI have a url function in my model, and call it like return HttpResponseRedirect(page.url)
mattmccThen you probably want to call the method.
EntityRebornhow so?
mattmccWell, right now you're passing a reference to the method itself to HttpResponseRedirect.
EntityRebornwell, adding a () to the end gives me a TypeError coercing to Unicode: need string or buffer, int found
EntityRebornand using a variable instead of directly calling it in HttpRR doesn't change anything
mattmccSounds like an unrelated problem, but most likely you have a __unicode__ method that isn't returning a string.
EntityReborn    def __unicode__(self):
EntityReborn        return self.title
EntityReborntitle = models.CharField(max_length=30)
EntityRebornthats in the model
mattmccThe traceback would probably be informative.
EntityReborngimme a sec
EntityRebornurl is defined as such:
EntityReborn    def url(self):
EntityReborn        return '/wiki/' + self.cleantitle + '/' + + '/'
EntityRebornwould I need to convert the id?
EntityRebornyes, thats what it was
mattmccYes, you can't concatenate strings and ints.  But you should use string formatting anyway, not concatenation.
mattmccThis isn't PHP, after all.
EntityRebornhow would I do string formatting?
gasullHi.  Debugging my view with ipdb I get this error:  Why form.id_valid() but I have no form.clean_data?  Thank you.
EntityRebornAs I've mentioned, I'm fairly new to python
mattmcc'/wiki/%s/%d/' % (self.cleantitle,
EntityRebornthanks :)
mattmccDive Into Python is a good read.
airstrikemattmcc: just don't say that in #python or someone might eat you alive
mattmccWell, that's their problem.
EntityRebornmattmcc, that actually explained other problems I was having with templates, as well
EntityRebornthanks :)
gasullIf form.is_valid() is True, then form.clean_data should exist, right?
mountainswhim1is it possibly to perform an outer join in django without resorting to raw sql
sontekwhat are some of the best blogs to read for django stuff?
sontekI have Leah Culver, Surfing in Kansa, Jannis Leidel, Eric Florenzano, and mountylounge right now
mattmccsontek: I would just keep your eye on the aggregator, and see who you find interesting.
Action: ubernostrum should write something.
sontekmattmcc: is there an rss feed for the full /community/ setion?
sontekI didn't see a link for it
ubernostrumHas an autodiscovery link.
sontekyeah, chrome doesn't know how to use those so I usually hope the site has a link, i'll just grab it from the source
ubernostrum<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/community/" />
ubernostrumChrome needs to learn how to use them.
Popular searches: get PGDATESTYLE   instrument error youtube   spllower   mumble overlay dx11   

Generated by 2.1mg by Jeff Waugh - return