u probably need to do `python manage.py syncdb`, as you have probably
installed the django.contrib.sessions application after you ran a syncdb
the last time.
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message be
vance ma wrote:
> Does the development enterprise application have the available report
> library?
What application? What library?
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because y
burcu wrote:
> Him Team,
>
> i want to set session expiry time in settings.py. Could you please
> help me regarding this case?
http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-cookie-age
--
Christian Joergensen
http://www.tec
respond to the SQL you are running?
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
o put in place of '???'
> Where does 'field__iexact' actually come from?
> Is it part of MyModel or somewhere else?
You don't need getattr:
MyModel.objects.filter(**{
my_dict['search_field'] + '__iexact': my_dict['search_val
his is the case I get an error
> when I do 'del request.session['percent']'. How do I check to see if
> 'request.session['percent']' has been created?
if 'percent' in request.session:
del request.session['percent']
Regards,
C
commands
>>> [line.split()[0] for line in
commands.getoutput("/usr/bin/who").split("\n")]
['razor']
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed
ast where your project worked?
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send em
odule. What is it?
Try importing markdown and running the above snippet outside of django
in a python shell. Does that work?
Regards,
Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscr
ell, func is my javascript function which
> handles data from django. but I am mainly confused about url.
`url` is the URL where jQuery will request the JSON data from.
It could be `/json/somefeed/` or whatever you have configured the URL of
your Django view to in urls.py.
Regards,
Christian
atabase instead,
and not so much whether you should use psyco or pyrex to speed up your
Python code.
Regards,
Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
Ethan wrote:
> In my first django project, use the apache server, in the admin page,
> it can't find the css file. and how does the admin css file generate?
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#id3
--
Christian Joergensen
http://www.tech
erField()s must actually be like ForeignKey(Person
> or Phone or Email or Address or eAddress) .. Any ideas on how to achieve
> this?
Why aren't you using ManyToManyField's? It sounds like that's what
you're trying to emulate ;)
Regards,
Christian
--
Christia
Lenny wrote:
> Hi!
> How can I assign a value to a model object field where the field name
> in a string?
As with any other python object, you can use setattr:
setattr(instance, "property", "value")
Regards,
--
Christian Joergens
d module in the standard library for python 2.5 (and 2.4)
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, s
unning `runserver`.
print "album_uri_to_copy is", album_uri_to_copy
album_feed = gclient1.GetFeed(album_uri_to_copy)
More about debugging django here:
http://simonwillison.net/2008/May/22/debugging/
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~
cache
> setting going on in my settings.py file. Is this a python cache
> issue? I've tried pkill python, but doesn't work either. Is there a
> template/web page cache in Django?
No there isn't.
Could you show us the code for yo
ue, just as if you wrote: var1 | var2 | var3
Another thing is - unless you use the key of the dictionary, a list
might be more appropriate for this ;)
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message
_to_response to have context processors activated and get any
context processor generated extra context variables available in your
template.
Use the RequestContext as a base context when using render_to_response:
return render_to_response('contact.html', {
'form
).
What if one of the machines was unresponsive at the time of the upload?
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To p
oesn't
> print. Is there something simple I am doing wrong?
Is `todaysdate` listed in your context?
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
thing like:
>
> pub=t.techpubcombo.publications_set()
I believe this would work:
publications = Publication.objects.filter(techpubcombo__technology=t)
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this me
= Model.objects.all().values_list("id", flat=True)
for obj_id in objs:
obj = Model.object.get(pk=obj_id)
do_something(obj)
... and my RAM usage was below 30 MB at all time.
> Maybe it's getting late and I deserve a nice gin and tonic...
Cheers,
--
Christian
you. I didn't know about that function. That is certainly prettier
than my "hack" :)
I assumed that was the default behaviour when iterating. There shouldn't
be any need to cache previous items, as there (to my knowledge).is no
way to retrieve previous items from a python ite
I looked at the queryset API, but it seems that there is no
> alternative to qs.exclude().
What's wrong with exclude() as it is now?
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribe
- I set DEBUG to False
> - I defined an Admin user and entered my email address
> - I ensured that Postfix is installed and running
>
> Is there anything else I need to do? I will gladly provide any extra
> information to troubleshoot this.
Does postfix receive the e-mail? Check
inside
> the django process to know what I did.
You could probably just read it from sys.argv ;)
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
ite.
from BeautifulSoup import BeautifulSoup
class BeautifulSoupPrettifyMiddleware(object):
def process_response(self, request, response):
if 'text/html' in response['Content-Type']:
soup = BeautifulSoup(response.content)
response.content = so
complicated, so please let my know if I
can clearify anything ;)
The source code for CurrencyValue and CurrencyField is here:
http://dpaste.com/14508/
Thank you,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
nclear on that issue.
I'll go with the DecimalField.
Thank you,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
rtconner wrote:
> Oh yeah I also wrote a FlashMsgMiddleware that makes this even easier.
> It's not needed at all, but it'll save you a line of code here and
> there. I can't post it if anyone wants it.
Why not just post it to http://www.djangosnippets.org ? :)
--
Chri
/python
or something?
If anyone else has not done this before, I could start working with
getting it integrated by getting the user to do a `svn export` of the
docs to somewhere before firing up the admin :)
Regards,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razo
David Reynolds wrote:
> Christian,
>
> SmileyChris has a rather cunning application that does just that:
>
> http://smileychris.tactful.co.nz/ramblings/django-documentation/
>
Great, thanks. :)
Regards,
--
Christian Joergensen | Linux, programming or we
ook here:
http://www.djangoproject.com/documentation/install/
Note the first paragraph of "Install Apache and mod_python". Developing
your applications under mod_python is quite a hassle IMO.
Regards,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.r
nst the current nfa-branch and finish it off
some day ;-)
Regards,
Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
;re stuck.
You need to import the model files as modules. That is, you need to do
`import foo.models` in bar/models.py and `import bar.models` in
foo/models.py.
Then you should be able to do `foo.models.Variable.objects...`.
HTH,
Christian
--
Christian Joergensen
http://www.technobabble.d
then
you could just as well import it at the top of the file as you would
otherwise.
* that is, `import ...` not `from ... import ...`.
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are su
s a queryset. Methods on querysets that return
new querysets never raises DoesNotExist.
See which methods that returns what on:
http://www.djangoproject.com/documentation/db-api/
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
Y
oot access) for that. So use
sudo og su if you have that kind of access. Else you need to contact
your administrator and have her do the updates for you.
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message
Greg wrote:
> Hello,
> I'm trying to add a record to a ManyToMany table in a script.
Use obj.m2mfield.add(related_obj).
/Christian
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are su
Ian wrote:
> I am .Net developer looking to switch over to Python.
>
> I have started looking at Django and was wondering if there is a
> widget equivalent to ASP.Net's GridView in terms of richness of
> functionality.
What does ASP.Net's GridView do?
Regards,
--
Django idiom.
If you insist, you could probably do (using 0.96):
from django.core.management import syncdb
syncdb()
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed
x27;s a better way to do this, but I can't seem to find
> an answer. Help!
Use the RequestContext:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~-
solved at driver
level, but is an application level problem.
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
h__', '__init__',
> '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__',
> '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__',
> '__rm
d required" to make CSS styling easier.
Am I overlooking something, or is newforms missing this?
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
ld:
Just thought I would mention my solution if anyone else is interested ;)
Also, please let me know if anyone else have an easier solution to this.
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
Christian Joergensen wrote:
>>> Is it possible to have css classes attached to newforms widgets? I would
>>> like to be able to distinguish between fx. checkboxes, radio buttons,
>>> submit buttons, text fields (which are all 's).
>
>> well, you ca
the template could be used.
Couldn't you just do href="/styles.css" ?
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
at/www/scripts/cronjobs/mail_editors.py: line
> 5: syntax error near unexpected token `settings'
> /var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line
> 5: `setup_environ(settings)'
>
> Here´s the test-script:
>
> # coding: utf-8
You're
e', maxlength=30, choices =
> Choice.filter(""), null=False, blank=False)
Normally, one would use a foreign key in this case:
choice = models.ForeignKey(Choice)
Regards,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.
't you just have an entry like this in your urls.py:
(r'^events/(?P[^/]+)', 'project.application.views.view')
And in your view collect the slug and look it up:
def view(request, slug):
s = get_object_or_404(Event, slug__exact=slug)
I don't underst
ng:
[...]
> Exception Type: SyntaxError
> Exception Value: invalid syntax (views.py, line 6)
What's on that line?
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
--~--~-~--~~~---
the Foreign Key relationship?
Don't delete the Teacher.
Instead, I would add a boolean field 'active' to the model and change
the value on delete.
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
--~--~
Do I really need to use custom SQL here, or does the django ORM provide
the means to solve this problem?
Thanks,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
E
> appname_soccerteam.country_id = appname_country.id) > 0']
> )
Great idea! I did not think about the 'extra' method. Works perfectly.
Gave me a speedup factor of about 250k :)
Thanks,
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
27; method. Works perfectly.
>> Gave me a speedup factor of about 250k :)
>>
>> Thanks,
>
> Alternatively you could use the normal django syntax:
> Country.objects.filter(soccerteam__name__isnull=False)
But the thing is, I can have multiple SoccerTeam relations. Doesn'
experience goes, this isn't possible.
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Description: OpenPGP digital signature
Christian Joergensen wrote:
> You could do a simple:
>
> def my_view(request):
> return render_my_view(request, request.session.LANGUAGE_CODE)
>
> def render_my_view(request, language_code):
> # do stuff
>
> render_my_view = cache_page(render_my_view, ca
sandro.dentella wrote:
> Hi all,
>
> how can I test from within settings.py if I'm running via mod_python
> or in standalone way? I need to set a variable, accordingly.
You could import os and look in os.environ for differences. Maybe
somthing differs.
--
Christian J
ve the thing is that your database
driver does not support unicode. Try to encode it to something.
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
--~--~-~--~~~---~--~~
You received this mess
Fabio Gomes wrote:
I m liked the simplicity of generic views, but i can´t find a way to set up
how many rows and cols my textarea have, is there a way to do it?
I believe you can style them using CSS. Please correct me if i am wrong.
--
Christian Joergensen | Linux, programming or web
is not at all possible. Can anyone shed some
light on this?
Thank you!
[1] Like: setattr(MyModel, 'foo', models.IntegerField())
--
Christian Joergensen | Linux, programming or web consultancy
http://www.razor.dk | Visit us at: http://www.gmta.info
signature.asc
Descriptio
Russell Keith-Magee wrote:
> On 1/20/07, Christian Joergensen <[EMAIL PROTECTED]> wrote:
>> I suspect there is some django magic happening behind the scenes, and
>> maybe the setattr trick is not at all possible. Can anyone shed some
>> light on this?
>
> Yes
page.
>
> Is there some ruling preventing me from using render_to_response in
> this way?
>
> Any advice welcome - it's driving me crazy!
Could it be a case of tab vs. spaces indentation? What more that Syntax
Error does the django error page tell you?
--
Christian Joergense
Hello,
I am experiencing an inconvenience in regards to working with signals
on model instances with deferred attributes. Specifically I am trying
to get a post_save signal to fire from a save() call on such a model
instance.
The problem is that the sender class (`origin` in
django.db.models.base
66 matches
Mail list logo