Django's best way to upload data into a postgresql database

2019-03-17 Thread Guillermo Yáñez Feliú
Hello, I’m working in a project that consists in converting a local postgresql database (that uses sqlalchemy as the ORM) into a web application, in which I upload excel sheets, read them, do some small cleaning and then upload selected data into a postgresql database using Django’s ORM. Th

Jinja templates structure

2017-02-24 Thread Guillermo Gonzalez
Hi guys! I'm involved in a big Django project and I'm trying to propose a way to organize the big amount of jinja templates that we have in our project. The way I'm proposing to oganize them is following a BEM methodology, where all the pages used by a DjangoView being in a *pages* folder, an

Re: Show HTML in Labels for Model Choice Fields

2013-05-22 Thread Guillermo Siliceo
Hey Adi your answer saved me lots of work, but i want to elaborate on it, i had this use case but i didnt have to subclass the field all i did was defined a new label_from_instance def Option_with_specie(self): return mark_safe(" %s "%(self.species.name, self.pk, self.name)) And then on t

virtualenvwrapper for Windows (Powershell)

2010-05-09 Thread Guillermo
Hi, If you've ever missed it on Windows and you can use Powershell, you might want to take a look at this port of virtualenvwrapper: http://bitbucket.org/guillermooo/virtualenvwrapper/wiki/Home Regards, Guillermo -- You received this message because you are subscribed to the Google G

How to share settings file in multiprogrammer project

2010-03-28 Thread Guillermo
same settings during development? Cheers, Guillermo -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@goog

Re: How to enforce uniqueness based on two model fields

2009-10-18 Thread Guillermo
ing! > > 2009/10/18 Guillermo > > > > > > > > > Ok I've done the following: > > > def save(self): > >        r = TargetMessage.objects.filter(src_fk=self.src_fk, > >                                        lang_fk=self.lang_fk) > >  

Re: How to enforce uniqueness based on two model fields

2009-10-18 Thread Guillermo
admin interface so that I know what's happened? Regards, Guillermo On Oct 18, 8:04 pm, Guillermo wrote: > Hi all, > > I want my records to be unique for field A and B together, so that no > two records can share the same values for those particular fields. How > can this be declared

How to enforce uniqueness based on two model fields

2009-10-18 Thread Guillermo
Hi all, I want my records to be unique for field A and B together, so that no two records can share the same values for those particular fields. How can this be declared in the model? Regards, Guillermo --~--~-~--~~~---~--~~ You received this message because you

How to restrict True value to only one row in table column

2009-10-18 Thread Guillermo
to make a sencond Thing master by mistake through the admin site. As far as I can tell, I have to override my model's save() method, but I'm not sure how well that will play with the automatic admin site... Regards, Guillermo --~--~-~--~~~---~--~~ You r

How to customize the default comments form from contrib.comments

2009-10-03 Thread Guillermo
Hi, Specifically, I don't want to require users to enter their email addresses or an url. Regards, Guillermo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Exception while rendering after installing contrib.comments

2009-10-03 Thread Guillermo
Hi, After installing the comments framework, I get the following error: The included urlconf django.contrib.comments.urls doesn't have any patterns in it I can't find any information about it. What could be causing it? I'm developing on Windows XP, Django trunk. Rega

How to establish foreign key contraints across models living in different applications

2009-09-26 Thread Guillermo
Hi all, I have one app with a Project model and another app with a TodoItem model. How can I declare Project to be the foreign key of TodoItem? Or, rather, how can I make TodoItem accept an arbitrary model as foreign key? Regards, Guillermo

Re: Development server starting two processes

2009-03-14 Thread Guillermo
ll script because I had this problem. I need to investigate this further. > To disable this, see the `--noreload` > option:http://docs.djangoproject.com/en/dev/ref/django-admin/#noreload Good. This should do the trick for me. Thanks! Guillermo --~--~-~--~~~---~-

Re: Type 'django-admin.py help. For usage.

2009-03-14 Thread Guillermo
ows.html#executing-scripts > My Computer\HKEY_CLASSES_ROOT\.py registry entry contains "C: > \Python26\python.exe" "%1" %* with the double quotes. I have this value here instead, with the same OS and Python version (ActiveState): HKEY_CLASSES_ROOT\Applicatio

Development server starting two processes

2009-03-14 Thread Guillermo
tirely reliably (the Powershell script might stop another random Python process). Should I be seeing only one process instead of two when I start the dev server? I'm on Windows XP Home, Django svn trunk. Cheers, Guillermo --~--~-~--~~~---~--~~ You received thi

Re: Ruby on Rails vs Django

2008-12-06 Thread Guillermo C.
Hi. - Scaffolding: I prefer it over django admin in many situations. I mean, when you're doing something complex you'll need to drop out the django admin and write your own code, so it's cool to have the basic CRUD code and develop from that. - Database ORM: Both orm (rail's ActiveRecord and Djan

Re: DateTimeFields not showing up in Admin page

2008-09-10 Thread Guillermo
y of doing this elegantly. Cheers, Guillermo On Sep 7, 2:07 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Since the whole point of those options is to ensure that the datetime > values are inserted automatically it would seem a little perverse to > want to make manual entries in t

Re: DateTimeFields not showing up in Admin page

2008-09-06 Thread Guillermo
I was using the "auto_now" and "auto_now_add" options. That seems to be the cause and to my knowledge there's no way to override this. Regards, Guillermo On Sep 6, 10:17 am, Guillermo <[EMAIL PROTECTED]> wrote: > Hi! > > I have this model with two `D

DateTimeFields not showing up in Admin page

2008-09-06 Thread Guillermo
Hi! I have this model with two `DateTimeField`s that aren't showing up in the Admin page. According to the documentation, the default value for `editable` is "True". I can't figure out what I'm missing... (I'm using version 1.0.) Here's the relevant admin.py code: class PostAdmin(admin.ModelA

Re: Problem in installing Django on Windows XP

2008-01-18 Thread Guillermo
Hakan, Assuming you are using Django 0.96.1, make sure you're installing from a top folder in your drive. E.g.: d:\django Not something like: d:\django\django\ That worked for me. Regards, Guillermo --~--~-~--~~~---~--~~ You received this message becaus

Re: TemplateDoesNotExist at /admin/

2008-01-16 Thread Guillermo
Now it worked! :-) These two folders were missing in my install: python/libs/site_packges/django/contrib/admin/templates python/libs/site_packges/django/contrib/admin/media Copying them from the downloaded django installation files does the trick. Cheers, Guillermo

Re: TemplateDoesNotExist at /admin/

2008-01-16 Thread Guillermo
ur > site-packages directory. I thought of that as soon as I saw J. Cliff Dyer's post. I'll give it a try and post back with the results. Thanks, Guillermo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: TemplateDoesNotExist at /admin/

2008-01-16 Thread Guillermo
code. Regards, Guillermo On Jan 16, 1:37 am, 1234 <[EMAIL PROTECTED]> wrote: > settings.py > > TEMPLATE_DIRS = ( > # Put strings here, like "/home/html/django_templates" or > "C:/www/django/templates". > # Always use forward slashes, even on Windows

TemplateDoesNotExist at /admin/

2008-01-15 Thread Guillermo
27;s out of the question for me now --can't use Subversion. I've gone through the tutorial twice step by step, so I don't think I forgot any instructions explained there. Does anyone know how to fix this? I'm dying to start developing website

Re: published permission

2007-02-28 Thread Guillermo Fernandez Castellanos
Hi, As far as I know, you can not do it. You are better using the generic views and crafting an add/update view of your own. Hope it helps, G On 2/28/07, Mary <[EMAIL PROTECTED]> wrote: > > Please any help will be appreciated i have a very soon deadline :( > > Thank you in advance; > Mary Ade

Re: sqlite problems

2007-02-14 Thread Guillermo Fernandez Castellanos
Hi, Try this (http://code.djangoproject.com/wiki/NewbieMistakes): Django says "Unable to Open Database File" when using SQLite3 ¶ Problem ¶ You're using SQLite3, your DATABASE_NAME is set to the database file's full path, the database file is writeable by Apache, but you still get the above erro

Re: making session var available to all templates?

2007-02-08 Thread Guillermo Fernandez Castellanos
Hi, > This has been asked several times, but I am not clear on how people > are solving it. From what I understand so far, a setting called > "TEMPLATE_CONTEXT_PROCESSORS" can be tweaked to make this possible. > However, I'm not seeing a clear way to do that. A context processor is nothing more

Re: How to set "REMEMBER ME"

2007-01-21 Thread Guillermo Fernandez Castellanos
Hi, I have some web sites where some identification is needed. In those, when I log in and do not explicitelly log out, I keep logged for days and days, and when I go back to the page I'm still logged in. i guess (and it's only a guess) that, because the authentification work with sessions, you'

Re: Generic Views - problem with template missing

2007-01-20 Thread Guillermo Fernandez Castellanos
Maybe you need the allow_empty=True option in your urls.py. G On 1/20/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > I'm using Django 0.95 release. > > I've got a simple blog, which I wanna move to generic views. > > in settings.py: > TEMPLATE_DIRS = ( > '/home/panos/projects/panos/templ

Re: newbie question

2007-01-18 Thread Guillermo Fernandez Castellanos
In that case, the problem seems to be in your urls.py file. The fact is, the name of yur app does not have to be the name of the url to access your app. I mean, you can have an app called 'fun' and access it as /fun/, /now/, /whatever/,... this will be defined in urls.py. Now, did you try to a

Re: newbie question

2007-01-18 Thread Guillermo Fernandez Castellanos
Hi, You are simply supposed to run Apache (/etc/init.d/apache2 start) and, if well configured, mod_python will take care of everything. With Apache, you're not supposed to use manage.py in any way. The thing you must think about is to add a web server to, well... serve the /media files. For tha

Re: Multiple applications and conflicting admin privileges ...

2007-01-17 Thread Guillermo Fernandez Castellanos
Mmm... it's a bit confusing. If I get you, you have 2 projects. Project1 has 2 apps that you would like to reuse in Project 2. And you have 2 different DB, one for each. And you are wondering how the projects will differenciate them? There is right now a thread about project and application dif

Re: Project organization and decoupling

2007-01-17 Thread Guillermo Fernandez Castellanos
I place my templates inside the "app_name/templates/app_name" directory. It seems template search path look for the template on this directory first. So, to decouple the app, templates should be inside it I think. But what would happen in this case if two sites use very different templates for

Re: mod_python/sqlite status

2007-01-17 Thread Guillermo Fernandez Castellanos
Hi, I use SQlite with Apache mod_python for my (low traffic) web sites. I find it really easy to manage, and it works just great up to now. It has never crashed in 3 months, can accept several users concurrently, is fast and has minimum configuration. I would recommend it for development and lim

Re: Django's FastCGI init.d script for Linux

2007-01-14 Thread Guillermo Fernandez Castellanos
Hi, I added it to the wiki, in a page linked to: http://code.djangoproject.com/wiki/ServerArrangements in a new index called "FastCGI init scripts" as you proposed. Thanks, G On 1/12/07, Michael Radziej <[EMAIL PROTECTED]> wrote: Hi, could you put this into the wiki? This type of stuff is

Re: A calendar-like view in Django/Python...

2007-01-14 Thread Guillermo Fernandez Castellanos
Hi, I've done something very similar myself and I've found the python module 'calendar' very useful, specially the monthcalendar function. If you're using the 2.5 version, they have the HTMLCalendar class, that looks also very promising :-) If you are interested in the specific code, send me a

Django's FastCGI init.d script for Linux

2007-01-12 Thread Guillermo Fernandez Castellanos
must be started #in a very specific way with manage.py. This must be done #for each DJango web server that has to run. ### END INIT INFO # # Author: Guillermo Fernandez Castellanos # <[EMAIL PROTECTED]>. # # Version: @(#)fastcgi 0.1 11-Jan-2007 [EMAIL PROT

Re: Running Django on OpenBSD...best practices?

2007-01-09 Thread Guillermo Fernandez Castellanos
Hi, Another option that has been considered by more and more people is Nginx. This page it's in polish, but the configuration files are pretty understandable: http://www.python.rk.edu.pl/w/p/django-pod-serwerem-nginx/ A podcast is here: http://mx.bw.rulez-forever.com/Django-Nginx-FastCGI-screenca

Re: restricting comments to registration/login using django.contrib.comments

2006-12-16 Thread Guillermo Fernandez Castellanos
If you want only registered people to use comments use Comments instead of FreeComments. G On 12/15/06, Milan Andric <[EMAIL PROTECTED]> wrote: > > In my urls.py, following the wiki docs on FreeComment, I'm using > (r'^comments/', include('django.contrib.comments.urls.comments')), > > But th

Re: variables within the skeleton template

2006-12-11 Thread Guillermo Fernandez Castellanos
Maybe middleware is what you are thinking of: http://www.djangoproject.com/documentation/middleware/ G On 12/11/06, Sigurdur Einarsson <[EMAIL PROTECTED]> wrote: > > Hello group, > > How can a call variables, objects, attributes within the skeleton > template. > > For example if I would like a d

Re: using a global login form

2006-12-05 Thread Guillermo Fernandez Castellanos
Hi, For every page login form, check: http://brehaut.net/blog/2006/08/21/django-user-logins/ No need to use the login view. Use the authenticate function instead. Hope it helps, G On 12/4/06, Milan Andric <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm having the same problem as this thread: >

Re: Database question

2006-12-01 Thread Guillermo Fernandez Castellanos
> It almost seems that I could do away with the MINISTRY_CHOICES piece > and just use the tags because if a tag name does not already exist the > admin interface will allow one to be created from the Entries page. If > that is the case then if I want a page to only display the posts for > music (a

Re: manage.py can't see project

2006-12-01 Thread Guillermo Fernandez Castellanos
ok... Try to do a ln -s (or simply move) of your django directory to the /usr/local/lib/python2.4/site-packages directory, so you have: /usr/local/lib/python2.4/site-packages/django/ Usually it's the place to put it. Maybe it's that... G On 12/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Re: manage.py can't see project

2006-12-01 Thread Guillermo Fernandez Castellanos
; and using nesh.thumbnail with no problem, it's just that manage.py > isn't recognizing it. > > I'm pretty sure I have a pythonpath and/or sys.path issue, but don't > know how to resolve it. When I output sys.path (as above), I don't see > any django stuff in th

Re: Database question

2006-12-01 Thread Guillermo Fernandez Castellanos
> Thank you. That is what I was thinking but I wanted to get others > opinions first. This will also help stay with the DRY ideals. I guess > the real difficult part would be if a new ministry is added to the > list. If I understand how it works I would have to make changes in the > model and then

Re: manage.py can't see project

2006-12-01 Thread Guillermo Fernandez Castellanos
Ok... blind try. If your my_project is in /path/to/my_project, and you have your manage.py in that directory, tr adding those lines: import sys sys.path.append('/path/to) I have to manually add the parent directory to the sys.path in order to use my applications. G On 12/1/06, [EMAIL PROTECTE

Re: Database question

2006-12-01 Thread Guillermo Fernandez Castellanos
Cheers, I would do it in a single table. Maybe i would add a field to the Post like: MINISTRY_CHOICES = ( ('MUS', 'music'), ('SIN', 'singles'), ('STU', 'students'), ) ministry = models.CharField(ma

Re: General File Upload Questions.

2006-12-01 Thread Guillermo Fernandez Castellanos
This might help you: http://code.djangoproject.com/ticket/2070 G On 12/1/06, Paul Childs <[EMAIL PROTECTED]> wrote: > > > Paul Childs wrote: > > > > 1. Is there an upper limit to the size of files that one can upload to > > Django? I am able to upload files of about 5 MB or less with no > > prob

Re: manage.py webserver

2006-11-29 Thread Guillermo Fernandez Castellanos
Hi, > > I suspect you hit one small Django controversy. The generic view > > object_list would give you 404 error when the list it tries to show is > > empty. The view is there, it works, finds the list -- all is Ok. It just > > has this strange behavior by default. To overcome it you can add > >

Re: Combining apps?

2006-11-19 Thread Guillermo Fernandez Castellanos
> The problem is that if I'm putting polls on every page of the blog, > then I have to change each URL in the urlconf to optionally include a > has_voted variable, right (since I'm returning people to their > originating page via a redirect, not via the POST request itself)? In this case, you can

Re: auto total field

2006-11-19 Thread Guillermo Fernandez Castellanos
Did you put the Stock model before the OrderItem model? Sometimes this makes problems. If you did, what about this as an alternate solution? class Stock(models.Model): price = models.FloatField(max_digits=10, decimal_places=2) class OrderItem(models.Model): quantity = models.SmallIntegerF

Re: Combining apps?

2006-11-19 Thread Guillermo Fernandez Castellanos
I use: return HttpResponseRedirect(request.META['HTTP_REFERER']) But maybe is this considered as bad practice? I am not familiar with such things and I've to improvise more often than not on such problems. it works perfectly for me in any case. Hope it helps, G On 11/19/06, ringemup <

Re: Template for a calendar?

2006-11-18 Thread Guillermo Fernandez Castellanos
And what about the admin "view on site" and the feeds? They both depend on the get_absolute_url. How could this be 'integrated' as well into your solution? G On 11/18/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Guillermo Fernandez Castellanos wrote: > &g

Re: Template for a calendar?

2006-11-18 Thread Guillermo Fernandez Castellanos
aner'. Another option would be to extract automatically my GUINDILLA_CALENDAR_BASE from the views with a urlresolvers, but it's even messier. Thanks, G On 11/18/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Guillermo Fernandez Castellanos wrote: > > In that case, pe

Re: Template for a calendar?

2006-11-18 Thread Guillermo Fernandez Castellanos
> One question though: Could you explain what GUINDILLA_CALENDAR_BASE > refers to? When you put an app somewhere it always comes with an urls.py that you include in your main urls.py. When you include that urls.py, you can include it under whatever name you want: (r'^events/', include('g

Re: Template for a calendar?

2006-11-17 Thread Guillermo Fernandez Castellanos
I've just implemented this for a web page: http://svn.guindilla.eu:8000/guindilla/trunk/guindilla/events/ It's probably not the most optimized solution, but it works for me. I use a context processor to pass all the information I need to create the calendar to all my views. I keep my events in t

Re: Blog engine

2006-11-16 Thread Guillermo Fernandez Castellanos
There is a few examples if you look in the mailing list: http://code.djangoproject.com/browser/djangoproject.com/django_website/apps/blog http://www.fallingbullets.com/blog/2006/nov/02/falling-bullets-source-code-you-ninnies/ http://www.rossp.org/blog/2006/may/15/django-magic-removal-upgrade/ http

Re: datetime in template not displaying

2006-11-13 Thread Guillermo Fernandez Castellanos
Check this: http://www.djangoproject.com/documentation/forms/#c1576 I had the same error a few weeks ago :-) Hope it helps, G On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi! > > I have "models.DateTimeField defined in my model as "date_today". > > date_today

Re: Add to Favourites type feature?

2006-11-11 Thread Guillermo Fernandez Castellanos
Hi, You have the UserFlag option in the django.contrib.comments code as an example of flagging applied to Comments. It might be easier to take the code and make it general with Generic relations: http://www.djangoproject.com/documentation/models/generic_relations/ or take it as an example for you

Re: moving django applications

2006-11-10 Thread Guillermo Fernandez Castellanos
.. G On 11/10/06, Sandro Dentella <[EMAIL PROTECTED]> wrote: > > On Fri, Nov 10, 2006 at 05:43:28PM +0100, Guillermo Fernandez Castellanos > wrote: > > > > Hi, > > > > Maybe this will help you: > > http://www.djangoproject.com/documentation/sites/ >

Re: moving django applications

2006-11-10 Thread Guillermo Fernandez Castellanos
Hi, Maybe this will help you: http://www.djangoproject.com/documentation/sites/ G On 11/10/06, sandro.dentella <[EMAIL PROTECTED]> wrote: > > hi all, > > how should I organize my configuration so that it's easy to have > several django applications in the same apache (not as virtual > domains

Re: Re: Generic Views

2006-11-06 Thread Guillermo Fernandez Castellanos
Got it!! I tried the code at home, and it did not work for me neither. I then tried object_list instead of archive_index and it worked well. So i tried archive_index again with the allow_future=True option and it worked. My guess: You are not on the America/Seattle time zone, and for the syste

Re: Generic Views

2006-11-06 Thread Guillermo Fernandez Castellanos
Hi, Sorry... I might have written too fast, it does not seem to be your answer... x Please, send the models.py and the urls.py and we'll try to have a look. G On 11/6/06, Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote: > Hi, > > Try adding the option allow_emp

Re: Generic Views

2006-11-06 Thread Guillermo Fernandez Castellanos
Hi, Try adding the option allow_empty=True in your urls: http://www.djangoproject.com/documentation/generic_views/#django-views-generic-date-based-archive-index It is false by default, and when there's nothing to show, it throws a 404 error :-) Hope it helps, G On 11/6/06, [EMAIL PROTECTED] <

Re: Brasilian fellow with charcode problem...

2006-11-05 Thread Guillermo Fernandez Castellanos
Hi, I had the same problem in Spanish. You must save your templates as UTF-8. For example, in Windows Notepad you can do a save-as and choose UTF- as encoding, instead of ASCII. Hope it helps, G On 11/1/06, Italo Maia <[EMAIL PROTECTED]> wrote: > > Well, here's the problem, in portuguese(my id

Re: inclusion tag for login screen.

2006-11-05 Thread Guillermo Fernandez Castellanos
Check this: http://brehaut.net/blog/2006/08/21/django-user-logins/ If you want a complete and working example, tell me and I'll send you one. Hope it helps, G On 11/1/06, MerMer <[EMAIL PROTECTED]> wrote: > > I am thinking about creating a small login form as an inclusion tag, to > display wit

Re: Template Apply

2006-11-04 Thread Guillermo Fernandez Castellanos
Hi, I use the include tag: {% for object in object_list %} {% include "myapp/object.html" %} {% endfor %} The nice things is that include renders the template with the current context, that is automagically passed to the myapp/object.html template: http://www.djangoproject.com/documentation/

Re: wrong hashed pw for web admin interface

2006-11-03 Thread Guillermo Fernandez Castellanos
It seems to me that you might have created the user but you did not give him the privileges to enter the admin interface. Enter the admin with your... admin user :-) Go to Users, select the user and check the 'Is staff' option to allow him to enter the admin site. Then, logout and try to enter wi

Re: Does Django have convenient multilevel access?

2006-11-01 Thread Guillermo Fernandez Castellanos
Hi, I have a system with 3 levels of permissions in an app at work, and it has been relatively easy to do. You have three things that will help you: - The ability of creating "groups" with different permissions. - The @login_required and @permission_required, that will allow you a per-view restr

Using admin js in template code

2006-11-01 Thread Guillermo Fernandez Castellanos
Hi, I've a model with a DateTimeField in it, and I'm creating a form to add objects. So, I create the form for the DateTimeField. Up to here, everything ok, it works. Now I would like to add the js helpers we can find when we use the admin to create an object (the little calendar and watch with

Re: django for non-web apps?

2006-10-31 Thread Guillermo Fernandez Castellanos
e ago that there's a function that allows to automagically do this by adding it at the beginning of a program. Hope it helps, G On 10/31/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > I think the tricky part is what Guillermo is saying. All views take a > request object a

Re: django for non-web apps?

2006-10-31 Thread Guillermo Fernandez Castellanos
It's something I've often though about. I've used databases in many projects, both web and not-web based. And I am now sure that Django would have been a great help in those non-web applications as well. The problem would then be to strip Django of all those web-specific libraries it's bundled w

Re: Just when I think I've got Karma working

2006-10-31 Thread Guillermo Fernandez Castellanos
/ and is sometimes difficult to answer such questions without the whole code and some testing. Hope it helps, G On 10/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Guillermo Fernandez Castellanos wrote: > > Hi, > > > > Just guessing, but if I understood we

Re: Just when I think I've got Karma working

2006-10-30 Thread Guillermo Fernandez Castellanos
to this object (self.karmascore_set.all()) and calculate the total karma by iterating over those. Hope it helps, G On 10/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > With help from Malcolm, Guillermo and others, I thought I had this > karma thing working. Apparently I do not.

Re: Combining apps?

2006-10-30 Thread Guillermo Fernandez Castellanos
You can find the actual code here. For the template tag: http://svn.guindilla.eu:8000/guindilla/trunk/guindilla/polls/templatetags/guindilla_polls.py Fo the html: http://svn.guindilla.eu:8000/www_guindilla_eu/templates/guindilla/polls/open_polls.html And for how to use it: http://svn.guindilla.e

Re: Sharing models between apps

2006-10-30 Thread Guillermo Fernandez Castellanos
Cheers, The nice thing is, you can import your models to any application. For instance, you have app1/gallery with models.py inside that defines Photo and Gallery, and you have app2/photorating with models.py inside. You need for your Rating model in app2 to use the Photo model of app1. No worr

Re: Yet another karma/comment question

2006-10-26 Thread Guillermo Fernandez Castellanos
Hi, Looking at the model, you can see that: class KarmaScore(models.Model): user = models.ForeignKey(User) comment = models.ForeignKey(Comment) [...] So I would think that, if there's a comment of a given user, you can know if he voted or not by doing a template tag that takes a comm

Re: directed graph in default admin

2006-10-26 Thread Guillermo Fernandez Castellanos
Cheers, have a look at the Meta options order_with_respect_to and ordering: http://www.djangoproject.com/documentation/model_api/#order-with-respect-to Hope it helps, G On 10/24/06, John Lenton <[EMAIL PROTECTED]> wrote: > > Hi all. > I've got an app where I have a table of nodes, and a table

Re: Comments and karma tutorial

2006-10-25 Thread Guillermo Fernandez Castellanos
Sorry, back from a trip. Happy to see that some people tried it and that it works. Thanks! > I've been looking at this as well. It appears that the ratings and > comments are tied together and must be submitted together. Is this > true? I'd like a user to submit a comment along OR rate it OR

Comments and karma tutorial

2006-10-24 Thread Guillermo Fernandez Castellanos
Hi, I've written a tutorial (well... actually two in one) about how to use the Comment (not FreeComment) and Karma parts of Django: http://www.guindilla.eu/blog/2006/10/21/comment-and-karma-functions-django-framework/ It involves some changes to the code, as I've found what seems to be a bug. Th

Re: ImageField

2006-10-18 Thread Guillermo Fernandez Castellanos
Indeed... I made a mistake. I was thinking of: class Image(models): image = models.ImageField(...) post = models.ForeignKey(Post) That way you can have all images of a post like p.image_set.all() and you can construct the copy-and-paste URL. Sorry for the confusion, G On 10/19/06, berto

Re: Todo application -- where it is?

2006-10-18 Thread Guillermo Fernandez Castellanos
That's it, thanks! G On 10/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Here is a link to the Django Powered Sites: > > > http://code.djangoproject.com/wiki/DjangoPoweredSites#Variousapplications > > Look for WorkStyle. The project page is still up, but the sandbox was > broken last

Todo application -- where it is?

2006-10-18 Thread Guillermo Fernandez Castellanos
Hi, I remember seing in the Django website, in the examples section, a nice TODO application, developped with Django 0.91, with nice images (cartoon faces in different colors) and a nice model. There was a sandbox in the homepage to play with it. I was looking for it recently and it seems to hav

Re: ImageField

2006-10-16 Thread Guillermo Fernandez Castellanos
I had a similar problem. I havent found any definitive solution, but there is some solutions that might help: Create a new model: class Image(models): image = models.ImageField(...) Add to your post model: images = models.ForeignKey(Image) Then, create a special view to create posts, wh

Re: email_user with text/html type

2006-10-13 Thread Guillermo Fernandez Castellanos
Hi, This might help you get going (see at the end). I modified a bit the function that sends the mail in Django. It is probably very far from as good as it could be. I am actually surprised as well that there's no function for that. Hope it helps, G # Use this module for e-mailing. from djan

Re: Birthday

2006-10-13 Thread Guillermo Fernandez Castellanos
<[EMAIL PROTECTED]> wrote: > > On 13 Oct 2006, at 0:24, Guillermo Fernandez Castellanos wrote: > > I am trying to keep a birthday field in the database. But i am only > > interested in the day and month. Is there a way of using a DateField > > but only with day and month f

Birthday

2006-10-12 Thread Guillermo Fernandez Castellanos
Hi, I am trying to keep a birthday field in the database. But i am only interested in the day and month. Is there a way of using a DateField but only with day and month fields? Or should I use another solution? Thanks, G --~--~-~--~~~---~--~~ You received this m

Re: Django Project Manager for Vim

2006-10-10 Thread Guillermo Fernandez Castellanos
> * Filter out __init__.py files and any other files not needed. But take care. Some __init__.py files have actually code inside (like the /django/contrib/auth/__init__.py one) G --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: what about example of project ?

2006-10-07 Thread Guillermo Fernandez Castellanos
Hi, Some examples here: http://groups.google.com/group/django-users/browse_thread/thread/5615ffe5707d9b92/de7eb2cd4060bad5?lnk=gst&q=code+examples&rnum=5#de7eb2cd4060bad5 Enjoy, G On 10/7/06, Marco Amato <[EMAIL PROTECTED]> wrote: > > Hi ! > > I am not a big programmer , and I will found usefu

Re: Mile-high view of Django (was "Re: Cannot get Many to Many Relationship To work...")

2006-10-03 Thread Guillermo Fernandez Castellanos
Hi, This might help: http://simon.incutio.com/archive/2005/08/15/request Enjoy, G On 10/3/06, Tim Chase <[EMAIL PROTECTED]> wrote: > > >> Jay, I did read the documentation before jumping in - but > >> it's not all necessarily clear for someone who hasn't alot > >> of experience in Python of D

Re: URL config, patterns

2006-09-30 Thread Guillermo Fernandez Castellanos
Hi, > urlpatterns = patterns('probob.app1.views', > (r'^$', 'index'), > (r'^test/', 'XXX'), > ) > where XXX I want to refer to 'probob.app2.views.foo'; however django is > going to make it refer to 'probob.app.views.probob.app2.views.foo'. Is > there a way to get around this? Yes

Re: generic views and forms

2006-09-14 Thread Guillermo Fernandez Castellanos
Cheers, > It's not totally clear to me why i would want to go the way of creating code > & using manipulators > if all that can be done automatically :) It can indeed be automatically done for an object creation. But what about sending a mail? Or what about a form involving two models? Or made to

Re: Comments framework

2006-09-14 Thread Guillermo Fernandez Castellanos
plete, as well as easy to use. Many thanks to the Django community! G On 9/14/06, Mario Brandao <[EMAIL PROTECTED]> wrote: > > Guillermo, > > here have many projects created with Django that you can download and know it: > > http://code.google.com/hosting

Re: Invalid filter: 'smartypants'

2006-09-13 Thread Guillermo Fernandez Castellanos
Cheers, I've been looking at Lost-theories code lately, and actually, after looking at the Jeff's post, it seems that the smartypants filter is a filter that he modifie and dropped in the python path: """ As for SmartyPants -- there is a Python port. I've found it to be not quite as perfect as th

Re: Flatpages and home page

2006-09-13 Thread Guillermo Fernandez Castellanos
Cheers, I don't know if this has to do with the flatpages framework, but Django is sensitive to the trailing slash. I think some browsers add the trailing slash automagically, and this may be the case of yours. There is an option, the APPEND_SLASH in CommonMiddleware, that will rewrite URLs that

Comments framework

2006-09-13 Thread Guillermo Fernandez Castellanos
Cheers, I am thinking of using the comments framework for a project, although besides the FreeComment there's no real documentation about it that I have found besides the source. My questions are: - Did someone use it in a project accesible to others so I can get inspired from his example? - Wou

Re: Strange admin sqlite3 read error

2006-09-13 Thread Guillermo Fernandez Castellanos
Cheers, You're in a *NIX, aren't you? The error tells you everything: OperationalError: attempt to write a readonly database Just make sure the web server has write rights on the sqlite3 database, and on the "directory" where your database is. It's a common gotcha, and still now gives me nasty s

Re: stripping html of tags

2006-09-12 Thread Guillermo Fernandez Castellanos
Cheers, > i want to display a snippet of data from a html source, and i want to > strip it of html because an unclose tag will make the rest of the page > look like You have the striptags tag: http://www.djangoproject.com/documentation/templates/#striptags You can also access the function from o

Re: Weblog app simple?

2006-09-10 Thread Guillermo Fernandez Castellanos
Cheers, > Is there somoeone that have already built > a "very very light weblog" app that I can studdy > (I mean see the source code) > to buld my personal weblog (django based). > I have a simple weak and cheap webserver. I found this to be a good example: http://www.rossp.org/blog/2006/jun/08/d

Re: Problem querying M2M relationships

2006-09-08 Thread Guillermo Fernandez Castellanos
> Ok; I just re-ran the tests with SQLite, and I am getting the same problem. > > Poking through the bug database, it looks like you are hitting Bug #2091. > I've updated that ticket with the details of your problem, and what I've > been able to work out so far. Mmm... I'm used to look in the doc,

  1   2   >