thx
On 2. Okt, 19:40 h., Karen Tracey wrote:
> On Fri, Oct 2, 2009 at 3:18 AM, gentlestone wrote:
>
> > Hello Karen,
>
> > another issue. If I'm using unicode characters in model's doctest:
>
> > u"""
> > >>> osoba = Osoba(meno = u"Ľudmila", priezvisko = u"Šafářová")
> > >>> osoba.save
Remember that people often represent their best work, and I bet they
only answer the questions they're most confident about their
experience with.
If you care that much about your code, you'll be fine -- once you have
your 10,000 hours* in as a coder, people will be in awe of your code
to
My only dissatisfaction is that other contributors to this list seem
to do almost anything with very few lines of code, whereas I am using
many. And, being a newbie I naturally worry that I am on the wrong
pathway, having missed the turning.
Thanks to both for your reassurance.
Mike
On Oct 3, 1
If you're trying to add template tags, check this out:
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
Your custom tags go in a directory named "templatetags" in your app
directory.
Shawn
--~--~-~--~~~---~--~~
You received this message because
Your current approach makes sense. If you're concerned that you're
storing too much data in the session, you could just maintain a
session ID in the session and use that as a key for an sqlite3
database or something, or even a model in your app's database, if that
makes sense. Is there any
Mike,
I think you're doing it right. Unless you want that data to be in the
URL (perhaps) or sent page to page in post data (probably a bad idea)
sessions are your best option.
-David
On Oct 2, 6:16 pm, adelaide_mike wrote:
> Hi
> In my app the user needs to drill down through a series of temp
I've spent all day diagnosing this with no success. I would get random
errors in logs with the traceback below, showing a failure to create a
new session. Memcache logs show all 1 tries succeeding (I have
also confirmed the empty sessions are still held in cache after). From
what I can see, se
did you try
company.logo = relative_path
?
On Oct 2, 4:45 pm, Nan wrote:
> OK, this seemed to work:
>
> def create_a_company(name, logo_path):
> company = Company()
> company.name = name
> relative_path = path_relative_to_media_root(logo_path)
> company.logo.name = relative_pat
Hi
In my app the user needs to drill down through a series of templates
and their views to identify a house. We start with the city, then the
street and finally the house, in each case chosen from a rendering of
the possible values selected from the relevant database table.
I have all this worki
On Fri, Oct 2, 2009 at 6:40 PM, Matt wrote:
>
> Also, I meant if view a parent template, it looks for child templates
> around it that extend it. I think my question above is the other way
> around
>
>
I don't know what you are trying to ask. You don't view templates in a
browser. Rather, your
Hello all,
I'm making some first steps with Django having worked my way through
the tutorial.
I'm finding myself somewhat confused by the sites module. I would
like to run two or three different sites. It's trivial to 'create'
them using the admin interface, and it's clear how different object
Hi,
I am just reading about django comments framework that I planned to
use.
As I learned so far you have to have object to which comments belong
in the database as well. Let's say I just want to have comments
related to some paragraph on my page without having to create record
for each paragrap
On Oct 2, 10:39 pm, Fabrizio wrote:
> Hi all,
>
> I'm trying to rewrite all requests for my Django server running on
> apache+WSGI ( inside my local network) and configured as the WSGI's
> wiki how to, except that I set a virtualhost for it.
>
> The server which from I want to rewrite requests
Also, I meant if view a parent template, it looks for child templates
around it that extend it. I think my question above is the other way
around
On Oct 2, 6:33 pm, Matt wrote:
> then do you view the child template in a browser, and it looks for the
> parent template, then outputs the all the co
then do you view the child template in a browser, and it looks for the
parent template, then outputs the all the code?
On Oct 2, 1:42 pm, Karen Tracey wrote:
> On Fri, Oct 2, 2009 at 7:00 AM, Matt wrote:
>
> > Does Django have a "radar", like it searches for child templates that
> > extends the
On Sun, Sep 20, 2009 at 6:46 PM, Hostile Fork wrote:
>
> Hello all,
>
> Page one of the tutorial features a large picture of a lightbulb, next
> to a statement of Philosophy:
>
> "Django apps are 'pluggable': You can use an app in multiple
> projects, and you can distribute apps, because they
Hello, i've been having a look at this post on overmortal about
Extending Django's Flatpages:
http://www.overmortal.com/blog/post/17-extending-django-s-flatpages
specifically this section "
Finally, in order to continue using the flatpages/default.html
template file as the singular file for han
OK, this seemed to work:
def create_a_company(name, logo_path):
company = Company()
company.name = name
relative_path = path_relative_to_media_root(logo_path)
company.logo.name = relative_path
company.save()
Thank you!
On Oct 2, 4:32 pm, Nan wrote:
> I tried this, but it'
I tried this, but it's just throwing an AttributeError ("can't set
sttribute"):
def create_a_company(name, logo_path):
company = Company()
company.name = name
logo_url = image_url_from_path(logo_path)
company.logo.url = logo_url
company.save()
On Oct 2, 4:15 pm, akonsu wro
hello,
try setting the logo.url property. i do it with FileFields all the
time and it works.
konstantin
On Oct 2, 4:12 pm, ringemup wrote:
> Say I have an image file on disk and a model that uses an ImageField.
> If I want to create a model instance with that image file in the image
> field wi
Say I have an image file on disk and a model that uses an ImageField.
If I want to create a model instance with that image file in the image
field without explicitly running through a form and a POST operation,
how could that be done?
Example of what I'm trying to accomplish:
class Company(model
Hello All,
i'm trying generate a single form with two models.
class Contact(models.Model):
phone = models.CharField(max_length=8)
email = models.CharField(max_length=50)
class Client(models.Model):
name = models.CharField(max_length=50)
type = models.CharField(max_length=10)
On Fri, Oct 2, 2009 at 11:49 AM, Jumpfroggy wrote:
>
> I have a model with a field, and I wanted to pull all the unique
> values of that field. So I do this:
>
>distinct_values = Model.objects.values('some_column').distinct()
>print 'distinct_values.count()', distinct_values.count()
>
On Fri, Oct 2, 2009 at 11:01 AM, Streamweaver wrote:
>
> I'm continuing to struggle with the reverse method in Django. After
> fixing some mistakes of mine earlier I'm getting an
> ImproperlyConfigured Error whenever I try to use a reverse method.
> The site works fine with one but whenever I try
Given the following models
class Product(models.Model):
price = models.IntegerField()
class Product1I18n(models.Model)
parent = models.ForeignKey(Product)
language = models.CharField(max_length=2)
title = models.CharField(max_length=255)
description = models.TextField()
is it po
On Fri, Oct 2, 2009 at 8:18 AM, akonsu wrote:
>
> hello,
>
> i have found an (undocumented?) way to get the db table name from a
> model: Model._meta..db_table.
>
> is there a way to get the name of the db column for a field?
>
>
Model._meta.get_field_by_name('')[0].column
Karen
--~--~-
On Fri, Oct 2, 2009 at 7:00 AM, Matt wrote:
>
> Does Django have a "radar", like it searches for child templates that
> extends the parent template?
>
No.
Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
On Fri, Oct 2, 2009 at 3:18 AM, gentlestone wrote:
>
> Hello Karen,
>
> another issue. If I'm using unicode characters in model's doctest:
>
>u"""
>>>> osoba = Osoba(meno = u"Ľudmila", priezvisko = u"Šafářová")
>>>> osoba.save()
>>>> subjekt = Subjekt(nazov = u"Žaba s.r.o.", osoba
On Thu, Oct 1, 2009 at 8:11 AM, gentlestone wrote:
>
> [snip]
> My question is. Can anybody explain, what does it mean? How should I
> rewrite my doctests in above way? How this piece of code should be?
>
> def slugify(name):
>u"""
>>>> slugify(u'Žabovitá zmiešaná kaša s.r.o')
>u'zabo
On Fri, Oct 2, 2009 at 7:51 AM, Marcelo Criscuolo (Jaú)
wrote:
> I'm thinking of something like this in the view:
>
> response = HttpResponse(mimetype="")
> input = read contents of your hidden file
> response.write(input)
> return response
and once it's working, replace the actual data copying
i guess i can use this:
def field_sql(table, field) : return '%s.%s' %
(connection.ops.quote_name(table), connection.ops.quote_name(field))
select_sql = connection.ops.date_trunc_sql('year', field_sql
(MyModel._meta.db_table, 'date'))
MyModel.objects.extra(select = {'year' : select_sql}).values
I have a model with a field, and I wanted to pull all the unique
values of that field. So I do this:
distinct_values = Model.objects.values('some_column').distinct()
print 'distinct_values.count()', distinct_values.count()
print 'len(distinct_values)', len(distinct_values)
Which giv
Hi,
I have a workflow type app I need to do and was looking at django with
goflow. I'm a total django noob - mostly I've done rails, php, web
objects, j2ee, and some other stuff. I can't seem to get the demos
working and the goflow mailing list is silent. Is that project
abandoned? Is
Hi, I want add a new attribute in User model and create custom backends.
Steep by steep, I did the following:
1) I created an application named "profile" into my project
2) I created, in models.py of "profile" a class named "UserProfile",
which inherits
from User class of Django. I added "press_age
I'm continuing to struggle with the reverse method in Django. After
fixing some mistakes of mine earlier I'm getting an
ImproperlyConfigured Error whenever I try to use a reverse method.
The site works fine with one but whenever I try to use a reverse
method, even in shell I get the following err
Thanks Maggie for your quick, response you keep me going. I hope to find one
these tools that translate UML into Models. Thanks very much.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
On Fri, Oct 2, 2009 at 9:28 PM, Geobase Isoscale wrote:
> Hi Everyone,
> Is it possible to use UML and OCL or others like WebML modelling tools with
> Django. Because I find the conceptual design , logical design and physical
> design tend to be more comphrensive rather than just using the mod
hi,
kmike yazmış:
> My solution was
>
or
> urlpatterns += patterns('',
> url(r'^my_wizard/$', login_required(MyWizard().__call__),
> name='my_wizard'),
> )
>
you add user control to call method for example
# request user authenticate control
if request.user.is_authenticated():
My solution was
urlpatterns += patterns('',
url(r'^my_wizard/$', login_required(MyWizard().__call__),
name='my_wizard'),
)
On 2 окт, 18:11, JimR wrote:
> After much searching, I found the answer that I was looking for -
> using the login_required decorator directly in the URLconf, then
> ad
I understand Fisher,
But the app is loading the 500.html directly if I create it.
I am receiving an error through email. Here it is:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line
86, in get_response
response = callback(request,
The built-in Django development server handles 404s and 500s, but when
you deploy onto mod_python or mod_wsgi, you need a 404.html and a
500.html.
On Oct 2, 4:52 am, Gustavo Senise wrote:
> Hey Mak,
>
> I understand that. The point is that locally the app is running fine! So how
> can I understa
Hi all,
Here's something that might be of interest to the Django crowd -
especially those based in Australia (or people who know someone that
lives in Australia).
On Wednesday, Australia's Government 2.0 Taskforce announced a mashup
competition. This competition is open to everyone, as long as e
Hi Everyone, Is it possible to use UML and OCL or others like WebML
modelling tools with Django. Because I find the conceptual design , logical
design and physical design tend to be more comphrensive rather than just
using the models.py classes that can overlook relationships, integrity
constain
> I search over the net, but I don't find how can do this. I
> need to pop up a dialog with: "Are you sure to delete this?"
> every time when I want to delete a row from a list, etc. Can
> you tell me where I found an exemple or some documentation, or
> how to pop up a dialog box in Django.
The t
Hi all,
I'm trying to rewrite all requests for my Django server running on
apache+WSGI ( inside my local network) and configured as the WSGI's
wiki how to, except that I set a virtualhost for it.
The server which from I want to rewrite requests is another apache
server listening on port
80. I ca
On 9 Sep., 12:18, Graham Dumpleton wrote:
> It is because from the server perspective the client connection was
> dropped before the request body had been able to be completely read.
> So, shouldn't be anything wrong with the application or the server.
> Can be caused by user aborting an upload e
I think you'll need some Javascript. Try jQuery:
http://jqueryui.com/demos/dialog/#modal-confirmation.
On Fri, Oct 2, 2009 at 3:23 AM, Nicu Marcu wrote:
> Hello all,
>
> I search over the net, but I don't find how can do this. I need to pop
> up a dialog with: "Are you sure to delete this?
I'd try to use HttpResponse as a file object. As in
http://docs.djangoproject.com/en/dev/howto/outputting-pdf/#write-your-view.
I'm thinking of something like this in the view:
response = HttpResponse(mimetype="")
input = read contents of your hidden file
response.write(input)
return response
hello,
i have found an (undocumented?) way to get the db table name from a
model: Model._meta..db_table.
is there a way to get the name of the db column for a field?
thanks
konstantin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
hello,
this works with sqlite:
AppModel.objects.extra(select={'year':"django_date_trunc('year', \"date
\")"}).values('year').order_by().annotate(total = Count('id'))
i assume that for postgresql i would have to use date_trunc function.
is there a portable way to do this?
thanks
konstantin
--~
After much searching, I found the answer that I was looking for -
using the login_required decorator directly in the URLconf, then
adding a subclass of __name__ to the FormWizard class.
(r'^contact/$', login_required(ContactFormWizard([ContactFormPartOne,
ContactFormPartTwo])))
but since it com
Hey Mak,
I understand that. The point is that locally the app is running fine! So how
can I understand whats wrong?
2009/10/2 Maksymus007
>
> On Fri, Oct 2, 2009 at 1:46 PM, gustavo wrote:
> >
> > Hello fellows,
> >
> > I have been developing a little blog app as described in
> > http://www.ap
On Fri, Oct 2, 2009 at 1:46 PM, gustavo wrote:
>
> Hello fellows,
>
> I have been developing a little blog app as described in
> http://www.aprendendodjango.com, what means Learning Django. It this
> very interesting.
>
> But I've got problems when I tryed to deploy. It seems everything is
> ok,
Hello fellows,
I have been developing a little blog app as described in
http://www.aprendendodjango.com, what means Learning Django. It this
very interesting.
But I've got problems when I tryed to deploy. It seems everything is
ok, but the log server is telling me that it is searching for a
500.
I changed the _doctest.py line 2180 to:
if failures:
raise self.failureException(self.format_failure
(new.getvalue()).encode('UTF-8'))
Whitout this bug correction, the doctests with non ascii characters
doesn't work.
So your
>It says, instead write u'blah blah', which you ar
On Fri, Oct 2, 2009 at 12:58 PM, Daniel Roseman wrote:
>
> On Oct 2, 11:45 am, Maksymus007 wrote:
>> I used query in form
>>
>> a = X.objects.select_related('gate__keywords_set').filter(field=value)
>>
>> and then tried to get elements from related
>> a[x].gate.keywords_set - there is a RelatedM
Does Django have a "radar", like it searches for child templates that
extends the parent template?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-user
On Oct 2, 11:45 am, Maksymus007 wrote:
> I used query in form
>
> a = X.objects.select_related('gate__keywords_set').filter(field=value)
>
> and then tried to get elements from related
> a[x].gate.keywords_set - there is a RelatedManager object which forces
> me to call all() method to get elemen
I used query in form
a = X.objects.select_related('gate__keywords_set').filter(field=value)
and then tried to get elements from related
a[x].gate.keywords_set - there is a RelatedManager object which forces
me to call all() method to get elements. And problem is that this
causes additional queri
On Oct 1, 2:54 pm, Karen Tracey wrote:
> On Thu, Oct 1, 2009 at 5:33 AM, dijxtra wrote:
> > Traceback:
> > [snip]
>
> 234. value = field.widget.value_from_datadict(self.data,>
> self.files, self.add_prefix(name))
>
> > Exception Value: 'NoneType' object has no attribute 'widget'
>
Hi
I think you're already have it right. It means do
not write "print ..some stuff.." in your docstring.
It says, instead write u'blah blah', which you are
doing already.
My question is:
Isn't it expected that the doctest fails if you change
a letter because then the output will disagree with
yo
I pulled out non ascii characters, but anyway, how strange it is:
>>> Osoba.objects.all()
[]
>>> Subjekt.objects.all()
[]
>>> gama = Subjekt(nazov = u"Gama s.r.o", osoba = Osoba(meno =
"Ivan", priezvisko = "Zajac"))
>>> gama.save()
Traceback (most recent call last):
Hello,
There is something similar in django and Python with msgbox? I need to
have a confirmation before doing a deletion.
--
All the best,
Nicolae MARCU
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
Hello Karen,
another issue. If I'm using unicode characters in model's doctest:
u"""
>>> osoba = Osoba(meno = u"Ľudmila", priezvisko = u"Šafářová")
>>> osoba.save()
>>> subjekt = Subjekt(nazov = u"Žaba s.r.o.", osoba = osoba)
>>> subjekt.save()
>>> subjekt = Subjekt.objec
64 matches
Mail list logo