t; a Student
or a Staff role.
Does this fit better? Let me know
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub page
<https://github.com/lgiordani> - My Coderwa
list
you may use
values()<https://docs.djangoproject.com/en/1.2/ref/models/querysets/#values>or
values_list()<https://docs.djangoproject.com/en/1.2/ref/models/querysets/#values-list>
.
Let me know if this answers your question.
Regards,
Leo
Leonardo Giordani
Author of The Digit
As always with inheritance, I suggest to think twice before implementing
it, but in this case I'd say that it fits perfectly.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani
You are welcome! I'm glad to know that it was useful. I hope to post soon
some tips with real world examples.
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page&l
Hi all,
the third issue of the small series "Digging Up Django Class-based Views"
is out.
This latest post is about form views.
You find the whole series here
http://lgiordani.github.io/blog/categories/django/
I hope you will find it interesting and useful.
Cheers,
Leo
Leonard
mentation<https://docs.djangoproject.com/en/dev/ref/models/querysets/#year>does
things this way. I see that you succeded in filtering with
filter(end_start='2013')
perhaps end__startswith? In that case you are treating it as a string.
May you please check this and let me know?
Cheers,
Leo
May you please post your Event model?
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiordani&
solve such issues.
Until then I'd suggest you to do the following: the difference of averages
is the average of the differences (in this case, since the number of object
is the same for the first and the second average), so you can store in your
object the difference between published and i
Érico,
it is not really clear to me what you are trying to accomplish. That HTML
in MYVALUES is a try to show that line in the dropdown? And why is
"{{form|safe}}" there?
May you please decribe what you would like to obtain?
Cheers,
Leo
Leonardo Giordani
Author of The Digital
May you please post the code of Book and Author models? Thanks
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <
kage?
Let me know, cheers
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiordani>
2013
Take a look at
https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#naive-and-aware-datetime-objects
Basically you need to fix datetime objects adding a timezone.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me
e
two entries with the same number it is clearly not a primary key, so
probably you are filtering on the wrong column.
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://
Thank you! I am going to correct it asap.
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiord
What is foundation?
You said that
{{form.valor_ultimacompra}}
works. What about
{{form.valor_ultimacompra|foundation}}
?
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<htt
Can you please paste the code with a good formatting? To pastebin or
similar?
I'd like to see model, view and template.
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page&l
Hi all,
I want to share with you a post about class-based views.
Hope you find it useful.
http://lgiordani.github.io/blog/2013/10/28/digging-up-django-class-based-views-1/
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http:/
I think that the extra space between "floatformat:" and "2" is confusing
the template system. Try using "floatformat:2" without spaces.
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/le
Indeed this is a good solution. Just a typo correction, use "%" instead of
"@".
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgio
can better clarify what you want to accomplish, I can perhaps be
more specific.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My
ot; or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
Remember that settings.py is a Python module, so you can use any valid
Python code.
Let me know if you succeed.
Cheers,
Leo
Leonar
,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiordani>
2013/10/21 Mahantesh U
>
()? Do you need just one value or multiple?
If you need to pass a list to the template just fill the dictionary
accordingly, but follow Daniel's advice when rendering the list in the
template.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
u are trying to show a list of objects, however, I suggest you to try
and use a ListView, where you can define your queryset, as you tried to do
with the get_queryset() method.
Try and let me know if something starts to work. Feel free to ask further
if the matter is not clear.
Cheers,
Leo
L
g
>>> print logging.__file__
This should hopefully show us what logging is working behind the scenes.
Try and post the results
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHu
Can you check the code you posted? The get_query() function is empty so
this code, as posted, can not run.
Please post even the urls you are using to call the view.
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http:/
Ok, can you please try to traceback the command and post the results?
python django-admin.py startproject hello --traceback
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<htt
Please give me the information I asked you, otherwise I cannot figure out
what kind of problem you have.
Are you using a virtualenv? In that case, can you post the list of packages
you installed? If not, can you give details about the OS you are working on?
Leonardo Giordani
Author of The
Hi, are you using a virtualenv? In that case, can you post the list of
packages you installed? If not, can you give details about the OS you are
working on, Django version, and so on?
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on Ab
arameter, I'd create a
Factory, i.e. a class that returns a class. You can then loop over your
models and call the Factory, generating urls on-th-fly.
Does this make sense for you? Let me know
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profil
ide this last loop you can write something like
{{ user.field }}
since I have to check if the template attribute retrieving syntax also
performs getattr. if this does not work you have to store tuples as values
of the users dict, instead of fields, each tuple being (field,
getattr(user, field)).
problem.
Cheers
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiordani>
2013/10/11 Kamal
data I do suggest you to keep it simple and readable.
If you need to have each element in B appear just one time (uniqueness)
just perform a B = set(B) at the end.
Let me know if it works. =)
Cheers
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile o
I do not know MongoDB, so sorry if I get it wrong. I'd say that you have to
write
*result = [a.get_json() for a in
Player.objects.filter(position__position_name='DD')]
*
since in your attached document you set it this way (line 53).
Try and let me know
Leo
Leonardo Giordan
Are you sure that your DB contains only one entry with that name?
Try printing it in the view you use to render that template and check the
output of the development server.
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me
[...]
>>
>> {% for obj in objects %}
>> {{obj.label}}
>> {% endfor %}
>>
>> [...]
>>
>> This can also be written (and is perfectly correct):
>>
>> *VIEW*
>> def someview(request):
>> my_list_of_objects = *[exam.l
t_of_object}
return render_to_response('results.html', context, context_instance =
RequestContext(request))
*TEMPLATE*
[...]
{% for obj in objects %}
{{obj}}
{% endfor %}
[...]
(Please note that in the second example I left the previous nomenclature
for clarity's sake - in a r
think you are implementing some views or at
least using them in some code.
Can you give some details about the procedure you are implementing and the
exact issue tou are facing?
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me
Are you sure your DB has been synced after putting the ForeignKey(News) in
your Department model?
Can you post somewhere the following models: News, OldNews, Department?
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me
e is not filtered, but
overwritten. Furthermore, you use return in a for loop, so the result of
your filter is 'DECEMBER 2011' irrespective of the input value.
Please check the above code, I wrote it directly in the mail composer, so
bugs are certainly lurking.
Let me know if you succee
Can you perhaps paste the view you are using to render the template? So I
can try and help your with some code
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com
I'd cycle in the template through a list of exam periods, printing a table
for each cycle.
You have to pass the list of exam periods in the context of your view.
Try and let me know.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile
ttp://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
https://docs.djangoproject.com/en/dev/ref/forms/api/
Feel free to ask more if you need help.
Cheers,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leona
implement something like the above code and see if it works.
As for the django_cart: when you modify the DB always use POST views and
not GET, then you are right, you have to return a template rendering in
your add_to_cart() view.
Let me know if it comes to life =)
Cheers,
Leo
Leonardo Giord
You have to implement an URL dispatcher that links an URL to your view.
Read here <https://docs.djangoproject.com/en/dev/topics/http/urls/> and
feel free to ask again if something is still not clear.
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile
Can you use the models.py file with the user field on a bare DB?
I mean: if you start from scratch with an empty DB everything works
correctly? You can create Carriers from the Django shell?
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me
I see now that you are not passing the CSRF token, are you?
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://githu
core apps
* syncdb
* inspectdb
* schemamigration --auto
* migrate
I strongly feel that your problem has to do with Django processing your
models BEFORE doing the base stuff.
Can you try this?
Regards
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My prof
You are using self.loan_amount, which is an attribute, as a function:
self.load_amount().
I suspect there is a missing sign (+-*/) between self.loan_amount and the
following (
May you confirm this?
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My prof
Ok, can you report the content of
/home/maurice/Desktop/django/Servant/Dashboard/models.py around line 264?
Your error is there.
Simply paste the output of "nl models.py | grep 264 -C 20"
Regards
PS: Rember to reply to the list =)
Leonardo Giordani
Author of The Digital
our issue, so that we can
come up with a solution.
Regards,
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https
me know what happens. Regards
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://coderwall.com/lgiordani>
your
application's user model in the settings.py file.
Let me know if I correctly understood your issue.
Regards
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://githu
Can you perhaps better describe what you are trying to do?
Do you need it in a view or in a template?
Regards
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com
=somevalue". May
you perhaps check the devel server output?
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHub
page<https://github.com/lgiordani>- My Coderwall
profile <https://c
Hi Maurice,
where do you get this exception? Do you have a Django debug page as output?
Are you calling a view? Can you paste its code?
Leo
Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani> - My GitHu
group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
Leonardo Giordani
--
You received this message because you are subscribed to the Google Groups
"Django users&qu
Hi all,
I'm trying to enhance a form in the admin site for a given model (Django
1.3). The relevant part of the model is the following
class Project(models.Model):
[...]
icon = models.ForeignKey(Icon, null=True)
[...]
and the admin is a simple call to admin.site.register().
This way I get a
Hi all,
I'm developing a site where the object Project is referenced by zero or
more objects Image, say basically
CODE
class Projects(models.Model):
pass
class Image(models.Model):
project = models.ForeignKey(Project)
Can you detail your problems? I installed it on a 11.10 some time ago and
perhaps I can help you
2012/2/20 jigbox
> The installation guide has instructions for Ubuntu 10.10 and below
> users.
> However, there is no help for Ubuntu 11.10 users. since I am facing
> some uncommon problems, I reques
I think it is better for you to keep CSS images in /static folder too.
/media is better suited as a folder to host user-loaded content.
If you keep CSS and images in /static you can just refer to them with
a relative path.
I think that probably (but I'm not sure) CSS can only address relative
pat
not understanding you, but regarding 2 and 3, if jQuery
> isn't being loaded, shouldn't you be getting a 404 error for the
> jquery-1.6.4.js file?
>
>
> Cheers,
> AT
>
> On Fri, Oct 28, 2011 at 11:30 AM, Leonardo Giordani
> wrote:
>>
>> Hi, thank
sorry if I'm not understanding you, but regarding 2 and 3, if jQuery
> isn't being loaded, shouldn't you be getting a 404 error for the
> jquery-1.6.4.js file?
>
>
> Cheers,
> AT
>
> On Fri, Oct 28, 2011 at 11:30 AM, Leonardo Giordani
> wrote:
>>
&g
luck!
>
>
> Cheers,
> AT
>
> [1]
> https://docs.djangoproject.com/en/dev/howto/static-files/#with-a-template-tag
> [2] http://code.google.com/apis/libraries/devguide.html#jquery
>
> On Fri, Oct 28, 2011 at 11:05 AM, Leonardo Giordani
> wrote:
>>
>> Hi all,
Hi all,
I'm trying to add a bit of jQuery to a page in a Django site. It seems
that my jQuery scripts are simply not loaded, while JS scripts work
perfectly.
Evan Firebug does not see the jQuery file as loaded.
This is what I do in base.html
{% block javascript %}{% en
The add() method of a ManyToMany field adds the indexes of the given
objects to the field.
If you add a list, each index in the list is added to the field.
In the admin interface, when you edit a Company object, you see a
convenient automagically-created
menu which lists all Index object in your a
You are right, thanks.
2011/10/28 Russell Keith-Magee :
> On Fri, Oct 28, 2011 at 12:49 AM, Leonardo Giordani
> wrote:
>> This is a problem related to Innodb and MyISAM. Django uses this
>> latter,
>
> Incorrect. Django doesn't have any built in preference for Inno
This is a problem related to Innodb and MyISAM. Django uses this
latter, while probably your imported DB is an Innodb one.
Check here https://docs.djangoproject.com/en/dev/ref/databases/
Search Google for the matter too, you are not the only one experiencing it.
I would suggest getting rid of the
Hi Jaroslav,
you have to do the following
n = Company(name=my_name, country=my_country, isin=my_isin)
n.save()
n.indices.add(my_indices)
See here
https://docs.djangoproject.com/en/dev/topics/db/queries/#saving-foreignkey-and-manytomanyfield-fields
Bye
2011/10/27 Jaroslav Dobrek :
> Hello,
>
>
Hi all,
I'm trying to implement the following form: a first ChoiceField with values
"mode 1", "mode 2" or "manual".
Depending on its value I need to show a FileUpload field (mode1 or mode2) or
some CharFields (mode3).
I'm trying to mimic a desktop GUI, where you can three radio button and each
c
Yes you are right, I was not thinking about security. :)
Thanks
2011/10/20 Tom Evans
> On Thu, Oct 20, 2011 at 10:49 AM, Leonardo Giordani
> wrote:
> > No, I think I didn't correctly explain the matter; say I have a Thing
> model
> > with a list of strings in it.
>
ent
4. Submit the form
So I need to "modify" the view attaching fields which content comes from
what the user uploads.
2011/10/20 Venkatraman S
>
> On Thu, Oct 20, 2011 at 1:32 PM, Leonardo Giordani <
> giordani.leona...@gmail.com> wrote:
>
>>
>> I
Hi all,
I'm trying to implement a an application where the user creates a new object
through a form. Up to here I'm fine.
This time though the object creation involves loading a file and choosing
some data from it (say choosing some lines, for examples).
So I'm a little stuck here. How can I let
()
and everything works.
Leo
2011/9/22 Leonardo Giordani :
> This is very strange for me: even flatpages depends on Site
>
> /usr/local/lib/python2.6/dist-packages/django/contrib/flatpages/models.py:from
> django.contrib.sites.models import Site
>
> but there is no problem
Site the same way
manouche/models.py:from django.contrib.sites.models import Site
but I cannot syncdb it with other applications.
No one can help?
2011/9/22 Leonardo Giordani :
> Sure my application depends on the site app, I'm importing Site in my
> models.py.
> But manouche is
e app being installed, but when django loads the
> manouche.models file, it hasn't loaded sites yet.
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> Leonardo Giordani wrote:
>>
>> Hi all,
>>
>> I developed a Django applicat
Hi all,
I developed a Django application (named "manouche") using south. Thus
I have some migrations which build my database.
I want to setup a testing environment where I want to begin with a
clean db, create it with syncdb, migrate my application, load current
fixtures and run tests.
My instal
Hi Christos,
if you put
{% extends "somefile.html" %}
in your template, Django expects to find it in one of the directories
specified in your TEMPLATE_DIRS variable in settings.py.
They are considered in the order they are written, so the base.html you are
extending is the first you find in this
78 matches
Mail list logo