settings file being imported four times

2012-05-16 Thread Tomas Neme
is it normal that the settings file is being imported four times? I'd give more info, but I really have no clue what's going on here's my manage.py: from django.core.management import execute_manager import imp try: imp.find_module('local_settings') # Assumed to be in the same directory. exce

Re: Forms for updating a compound model

2012-07-04 Thread Tomas Neme
I'm sorry to tell you that ModelForms don't seem to have this functionality, but I'm happy to tell you that ModelAdmins do. What it does, basically, is to return this: { 'label': label_for_field(field, self.opts.model, self.opts), 'widget': { 'is_hidden': False }, 'requ

Re: problem with django model method save()

2012-07-04 Thread Tomas Neme
I don't see why wouldn't your model's .save() work, maybe we'd need to see the model code, but I know you probably want to read this: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ once you've implemented a ModelForm, you'd pretty much would just do form = RoomForm(request.POST)

Re: install a new model in my project

2012-07-04 Thread Tomas Neme
> (django_multiuploader), and i write in INSTALLED_APPS 'sorl.thumbnail', > 'multiuploader', then i execute manager.py runserver and return "Error: No > module named multiuploader" I dont understand how make a link for this > module. *How* did you install it? are you using pip and a virtua

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
You'll have to migrate your data manually in your migration, yes. Besides that, if you don't want actual Base instances, then this is an abstract class, and you should do this: class Base(models.Model): eggs plants class Meta: abstract=True class Foo(Base): carpet

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Tomas Neme
On Wed, Jul 4, 2012 at 5:29 PM, Tomas Neme wrote: > You'll have to migrate your data manually in your migration, yes. > > Besides that, if you don't want actual Base instances, then this is an > abstract class, and you should do this: > > class Base(models.Mod

Re: cannot access admin

2012-07-04 Thread Tomas Neme
ah, got it... your url(r'^(\S+)/(\S+)', 'tacobakedotnet.dotnet_forms.views.home'), is too permisive On Wed, Jul 4, 2012 at 6:54 PM, Scott Somers wrote: > > /Local Python Source Code/tacobakedotnet > manage.py > settings.py > urls.py > /Local Python Source Code/tacobakedotnet/media > JavaScript

Re: cannot access admin

2012-07-04 Thread Tomas Neme
On Wed, Jul 4, 2012 at 7:33 PM, Tomas Neme wrote: > ah, got it... your > > url(r'^(\S+)/(\S+)', 'tacobakedotnet.dotnet_forms.views.home'), > > is too permisive ... maybe? -- "The whole of Japan is pure invention. There is no such country, there

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Tomas Neme
I wanted to chang the subject because I didn't want to spam someone's plead for help into a design discussion, but then I thought, how am I gonna make sure this is read by the right people? Also, context would be lost, so.. sorry about this But I don't see how what you say makes sense. I mean, al

Re: ForeignKey on CharField and char operations

2012-07-05 Thread Tomas Neme
I might not be understanding this fully, but what about A.objects.filter(type__mnemo__startswith="type1")? On Thu, Jul 5, 2012 at 7:51 AM, Serg Shtripling wrote: > Hello, community! > Have anyone tried this: > class AType(models.Model): > #cut > mnemo = models.CharField(u'Mnemocode', max_

Re: migration via south for inheritance change -> please help

2012-07-05 Thread Tomas Neme
> Not really. But from the question: > "But how can I tell south to fill the super class with the data from the > old schema?" Well, in aswer to this, and Tom's remarks, you assumed he wanted to have a new table because he was asking how to populate it, I assumed he maybe doesn't know about abstra

Re: ForeignKey on CharField and char operations

2012-07-05 Thread Tomas Neme
> Wouldn't it create INNER JOIN query on a_type table? AFAIR it would and it's > a bit overhead. > But surely it is a better solution than mine one, thanks for that. Well, in that case, I think your problem is that your AType PK isn't the mnemo field, but some integer field, so type_id is integer,

Re: ForeignKey problem

2012-07-05 Thread Tomas Neme
> But! I do have another problem. Lets ditch our football example. Let's say > that I have something like that: > > class CherryTree(models.Model): > name = models.IntegerField() > cherries = models.ManyToManyField('CherryFruit') > > class CherryFruit(models.Model): > name = models.Char

Re: install a new model in my project

2012-07-05 Thread Tomas Neme
> I used pip for install sorl.thumbnail but "multiuploader" it isn't in > the pip's repo well, HOW did you install it? you can still tell pip to use a git or mercurial repository, or a tarbal file, for example (virtualenv) $ pip install git+git:// github.com/Lacrymology/cmsplugin_s3slider.git#e

Re: ForeignKey problem

2012-07-06 Thread Tomas Neme
> I don't understand. It's the same wheel added four times, not four > different wheels. I guess you could implement it either way. The thing is that doing it this way would become complicated at the time you need to define what is attached where. For Lego pieces, I'd do this: class LegoType(Mode

Re: ForeignKey problem

2012-07-06 Thread Tomas Neme
> Thanks, but damn, isn't that overly complicated (for me). Using through > looks like a easier way, but then I have to add Wheel four times and can't > just type '4' in some field, since I don't need it to exist in database four > time, just an information that there are four wheels. as I said, i

Re: ForeignKey problem

2012-07-06 Thread Tomas Neme
oh, and the advantage is that you could have a car, for example car = Car.objects.get(name="4x4") car.parts.get(name="Transmission").partsincar.amount >> 2 The difference with doing it with another model is that you cannot do this, for example (or not as easily) Car.objects.filter(parts__name="

Re: Returning nothing from a view

2012-07-06 Thread Tomas Neme
Just return an empty response, with a 200 OK code: return HttpResponse("") I'm not sure whether you can omit the "" On Fri, Jul 6, 2012 at 5:44 PM, Larry Martell wrote: > I have a situation where I'm sending an ajax request to a function > that updates a row in database. I then want to return c

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Tomas Neme
> The big difference is, -as I see it- I will not get real polymorphism, > as the base class would need to do the join on all it's child classes. > Is that true? with abstract models you won't get polymorphism at all, in the database level (this is, you WON'T be able to do Fruit.objects). You'

Re: migration via south for inheritance change -> please help

2012-07-07 Thread Tomas Neme
> and I do > for fruit in Fruits.objects.all(): fruit.rott() > > will anything happen at all? I know in C++ this would work... ;-) > > on database-level I know how to do it, I just don't know if the django > abstraction handles this automalically. I.. don't know. I'd think yes, at least I wonder o

Re: Problem with DetailView

2012-07-08 Thread Tomas Neme
> Turns out that's the problem. I wanted to use a field from my Car model: > car_id, so the link on the website would look like: > www.blablabla.com/cars/3421, where 3421 is the car_id. Unfortunately, the > car_id is not the same as . Can I achieve something like that with class what's car_id and

Re:

2012-07-08 Thread Tomas Neme
Are you importing your listeners.py from anywhere? -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. -- You received t

Re:

2012-07-08 Thread Tomas Neme
> No, I'm not. I didn't think I need to... the only things that are automatically included are your settings file, your site urls file, and your apps' models file, everything else depends on you (or them) to include them. For example, if you don't call admin.autodiscover() sometime soon (your site

Re: Problem with DetailView

2012-07-08 Thread Tomas Neme
Man... > (r'^sets/(?P\d+)/$', SetDetailView.as_view( > model=Set, > context_object_name="set_details", > template_name='data/set_details.html', > )), > > But the site is empty. Here's my extremely simple template: > > {% block title %}{{ set.text_name }}{% endblock %} > > {% block

Re: urlpatterns

2012-07-08 Thread Tomas Neme
Django isn't able to guess you want your polls urls under a /poll/ path. To achieve this, you do url inclusion you define something like polls/urls.py like you did and then do url(r'^polls/', include('polls.urls')) then your defined urls will work when prepended with a polls/ path. You can chan

Re: Model for ListView needed?

2012-07-08 Thread Tomas Neme
> A queryset returns a /list/ of model instances. Thus you should queryset > when you want more then one instance of the model displayed. well, slightly wrong, let's clarify. While it's true a queryset represents a list of model instances (it's not EXACTLY that, it's, more like, a partially set up

Re: Model for ListView needed?

2012-07-08 Thread Tomas Neme
Oh, and setting up a queryset in a DetailView means that it won't work for instances that are not inside the queryset, if we did url(r'/books/shakespeare/(P\d+)/$', queryset=Book.objects.filter(author='shakespeare')), then /books/shakespeare/1/ would work if the book with pk=1 was Romeo and Juliet

Re: Adding a custom validation to Django's auth_user in admin

2012-07-08 Thread Tomas Neme
> Ah. I think the method is overriding the edit page. In other words, you have > click on the editpage to see the effect of my fail code. So it doesn't > trigger if you are on the list view page. Does anyone know what to do with > the editable submission? > It should use the same clean_ method, sho

Re: masking only a small part of a template

2012-07-09 Thread Tomas Neme
http://djangosnippets.org/snippets/1376/ this is what you want, I'm using it and it works like a charm you override in templates/path/to/template.html and do {% extends "app:path/to/template.html" %}, and this loader searches in `app`'s template dir by default On Mon, Jul 9, 2012 at 3:06 AM, tW

Re: rendering modelForms

2012-07-10 Thread Tomas Neme
There's a way, but you'll need to touch the form on the python side quite a lot, changing the default widgets adding them the css classes you want. You can take a look at https://github.com/earle/django-bootstrap and https://github.com/dyve/django-bootstrap-toolkit/ they provide some shortcuts for

Re: getting variable from __init__ into clean_xxx function

2012-07-11 Thread Tomas Neme
also this: http://docs.python.org/tutorial/classes.html On Wed, Jul 11, 2012 at 12:58 PM, Nikolas Stevenson-Molnar wrote: > Change nbi_patch to self.nbi_patch, and you should be set. I.e: > > > class PatchForm1(forms.Form): > def __init__(self, *args, **kwargs): > self.nbi_patch = kwa

Re: Error in blog

2012-07-12 Thread Tomas Neme
Have you done the django tutorial, first? it covers named urls On Thu, Jul 12, 2012 at 11:06 AM, luthur wrote: > why not post your example? It's too abstract. > > -- > luthur > > On Thursday, July 12, 2012 at 9:56 PM, jun wrote: > > > > On Thursday, July 12, 2012 7:40:46 PM UTC+8, lawgon wrote: >

Re: django-admin.py makemessages issue

2012-07-12 Thread Tomas Neme
"django-admin.py makemessages -l de" "django-admin.py makemessages -l es" On Thu, Jul 12, 2012 at 2:59 PM, Phil wrote: > Hi, > > (django version 1.3.1, Python2.7) > > (at the end of my settings file) > > # translation support > ugettext = lambda s: s > > LANGUAGES = ( >

Re: Tasking? A fluid user experience with Uploading Media.

2012-07-14 Thread Tomas Neme
Well, first of all, you're gonna have to set up quite a big amount of parallel connections for this to work, > A new user could be uploading media/music files or something at the same > time as uploading a video of themselves. I want it to be efficient and fast > to the point where it all gets upd

Re: ajax loading html

2012-07-14 Thread Tomas Neme
an "html page" can't be located within the templates directory, an HTML file might, but what is it you want to do, exactly? you want to render a static file? does it make sense going through django for this? URLs point to views, not templates, the views are which decide what templates to use (the

Re: ajax loading html

2012-07-14 Thread Tomas Neme
On Sat, Jul 14, 2012 at 2:11 PM, ledzgio wrote: > If I use the TemplateViews method, should I have to set anything on the > views.py? and how can I point that file from template? the TemplateView is a view, it's already been written for you, so you can use it without adding anything new. If you w

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
Yes, you'll need to get your hands dirty, and merge the two admin templates, since both apps redefine templates/admin/index.html and some other templates. The best approach, I think, is just use django-admin-tools' templates and create custom dashboard/modules to duplicate satchmo's templates' beh

Re: Is Tutorial / Part 4 wrong? (or is it me?)

2012-07-16 Thread Tomas Neme
It's the second time this issue appears in the list in two weeks, maybe it's time to recheck the tutorial? There's no "polls" in your results' url, doesn't the tutorial say you should have two urls file? one in project/urls.py and another one in polls/urls.py ? the polls-specific urls shouldn't s

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
> I thought they extended the templates instead of trying to replace > everything they don't replace everything. But the admin site's index template is called 'admin/index.html', so it's not easy to extend them. They DO extend admin/base.html. This is my dashboard.py file, where I create a modul

Re: satchmo and django-admin-tools

2012-07-16 Thread Tomas Neme
> thanks for sharing, I'll try to understand it. > > where should I put this file? inside localsite? > > what admin template are you talking about? the admin tools or the plain > admin? dashboard's (it's part of admin_tools) admin/index template. > I thought of using the admin tools templates and

Re: Directory indexes are not allowed here. for Grappilli

2012-07-17 Thread Tomas Neme
On Mon, Jul 16, 2012 at 2:56 PM, Dott. Tegagni Alessandro wrote: > > write the urls.py code and var. static in settings.py, please. do as he says. Also you could try asking the grapelli user group, if there is one, this seems to be specific -- "The whole of Japan is pure invention. There is no

Re: Tutorial question

2012-07-17 Thread Tomas Neme
> Do these just get stuck onto the end of my class Poll(models.Model):? like > this... Yes, that's right perhaps you should start here: http://docs.python.org/tutorial/classes.html you should probably at least be comfortable enough with python to know how to define classes before diving into dj

Re: Prepopulating a contact form

2012-07-18 Thread Tomas Neme
user = request.user initial = {} if user.is_authenticated: initial.update({ 'name': user.name, 'email_address': user.email_address }) form = MyContactForm(initial=initial) On Wed, Jul 18, 2012 at 11:23 AM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a contact form in my app and w

Re: one field of modelForm doesn't being displayed

2012-07-18 Thread Tomas Neme
> You could override your ModelForm's save() method to save some data to that > field. And then modify the same ModelForm to exclude that field. For example, or maybe, just maybe, he might show us his model, form, and rendered html so we can actually help him identify and possibly fix his problem

Re: Query with 3 models

2012-07-19 Thread Tomas Neme
> {Empresa1, Sucursal1, Platillo1, Horario1}, > {Empresa1, Sucursal1, Platillo2, Horario1}, > {Empresa2, Sucursal1, Platillo1, Horario1}... I'm guessing the Sucursal1 in the first and third lines are not the same? I mean, each Sucursal points to only one Empresa, so I'm guessing you want only the

Re: Can a method call inside save() display its return on template?

2012-07-19 Thread Tomas Neme
> In my models.py I override the save method like this: > > def save(self, *args, **kwargs): > self.directiondb = get_direction_db(self.nod_id1.id, > self.nod_id2.id) > get_direction_descr(self.nod_id1.id, self.nod_id2.id) > get_vrd_code(self.nod_id1.id, self.nod_id2.id) >

Re: Query with 3 models

2012-07-19 Thread Tomas Neme
> Thanks, the first example is exactly that i want. I try it in the Django > Shell and it works, but; How I show the results in the template? > > Maybe I'm wrong, but I try to pass like { 'empresas': > Empresa.objects.all().select_related() } ,and only can show the 'Empresa' > attributes on the lo

Re: Can a method call inside save() display its return on template?

2012-07-20 Thread Tomas Neme
You can still do self.something = foobar even if "something" is not a database Field. What I mean is, doing self.vdr_code = get_vdr_code() will save it for THIS INSTANCE and then you can use it in your template. If you really need this to be only at .save() (instead of, say, at __init__, because

Re: Boolean always returns False?

2012-07-20 Thread Tomas Neme
why do you have your own User model? Are you sure you're logging in the right user and loading the right user instance? On Fri, Jul 20, 2012 at 12:37 PM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a user model in which i have a newsletter boolean field. When the > user subscribes to

Re: How is the label_tag's attrs parameter supposed to specified?

2012-07-20 Thread Tomas Neme
{% for field in form %} {{ field.label }}{{ field }} {% endfor %} although I think the custom form class is not such a bad solution -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny.

Re: How To Display Non-Modal Popup From Resulting Asynchronous Javascript Request

2012-07-23 Thread Tomas Neme
your error's got nothing to do with AJAX. As the very helpful error message you're getting, there's no URL that matches your requested path: > Request URL: > > http://127.0.0.1:8000/mediahelp/mediaHelpPopup.html > > Using the URLconf defined in streamingmedia.urls, Django tried these URL > patter

Re: How To Display Non-Modal Popup From Resulting Asynchronous Javascript Request

2012-07-24 Thread Tomas Neme
> The current URL, mediahelp/comphelp/mediaHelpPopup.html, didn't match any of > these. > > The code from the comphelp url view is very basic and looks like this: > def component_help(request): > view = "component_help" > dctnry = {} > reqGET = request.GET.copy() > if reqGET.has_key

Re: ManyToMany relationship with intermediate model and admin list display with each realtion with value as diferent column

2012-07-24 Thread Tomas Neme
> as shown in the picture, this i could do by add a method in the model > getTienda1 and return the stock and do it for each store, but i want it to > be created dinamically because the user could create a new store and it will > not be there. > > so this is my cuestion: can i do that? Interesting

Re: 'QuerySet' object has no attribute '_meta' ... but I'm not using a QuerySet!

2012-07-26 Thread Tomas Neme
The ArtworkForm AND the full view code would be helpful, yes also, maybe you'll want to install django-extensions, werkzeug, and run your devserver with runserver_plus, that'll give you full debugging capabilities on your browser, and will be able to see what's each object (that instace object, sp

Re: ignore field during form validation

2012-07-26 Thread Tomas Neme
> class Form(forms.Form): > > check = forms.BooleanField( > required=False, > ) > # take into account only when 'check' is True > len = forms.IntegerField( > min_value=3, > max_value=5, > required=True, > ) > > > What I want is to validate the 'le

Re: Can i use django book

2012-07-28 Thread Tomas Neme
While the things on the djangobook are probably still compatible, they're far of being best practices nowadays, and will lead you down old and abandoned roads, more times than not. As it's been said, I'd rather stay by the official docs, they're very clear and pretty helpful, not purely technical

Re: REMOVE ME

2012-07-29 Thread Tomas Neme
I'm very sorry. I got completely out of line. It's just something that irritates me a lot, and I'm not a native english speaker, and it may be I don't know the actual "value" of the word, I felt it was more funny than insulting. And I hadn't read your first reply. It won't happen again. -- "The

Re: Is there a way to use 'request.user' in a custom template tag without an inclusion tag?

2012-07-29 Thread Tomas Neme
> > class EditableNode(template.Node): > def __init__(self, location_name): > self.location_name = location_name.encode('utf-8').strip("'") > def render(self, context): > obj = Placeholder.objects.filter(location=self.location_name) > if request.user.is_authenticated(): > for x in obj: > return

Re: Variable # of fields in a form

2012-07-30 Thread Tomas Neme
maybe this will help? https://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup On Mon, Jul 30, 2012 at 5:06 AM, Alex Strickland wrote: > On 2012/07/25 12:41 PM, Daniel Roseman wrote: > >> You could probably subclass the CheckboxSelectMultiple widget and >> override the `render` metho

Re: access the state of a Model object prior to it's modification ?

2012-07-30 Thread Tomas Neme
uhm, if you register a listener to the pre_save signal, then you can do this: if instance.published: # the instance about to be saved has the published flag on dbojb = MyModel.objects.get(id=instance.id) # did it have it on the database? if not dbobj.published: do_stuff() you probab

Re: Dynamic forms

2012-07-30 Thread Tomas Neme
Just to be clear, sandeep, jQuery is not java, javascript is not java. Get yourself clear on that, because it can become a big confusion. Besides that, yes, without javascript, the only way you've got to do that, is having the user submit a form where he selects the options, and then return anothe

returning a zip file for download

2012-07-31 Thread Tomas Neme
Down here's the code in which I'm creating a zip file with a bunch of pdf labels, and returning it on the HttpResponse for the user to DL it. The weird thing is that I'm getting just a pdf file (ok, I'm testing with a single file, so I don't know if that's the problem) and I can't set the download

Re: returning a zip file for download

2012-08-01 Thread Tomas Neme
OK, I got it working, I'm not sure what the problem was, but calling the loop variable 'file' was overriding the python default file object class now I'm doing this: response = HttpResponse(File(file(tmp[1])), mimetype="application/zip") response['Content-disposition'] = ('attachm

Re: Noob question

2012-08-02 Thread Tomas Neme
as Kurtis says, drop the explicit Primary Keys, and drop the hungarian notation as well (don't declare the variable type on it's name): I don't need to be reminded that the name of a project will be a string, it's pretty obvious. Also, python standards talk against using underscore in class names,

showing a second level of indirection in an admin change_form page

2012-08-03 Thread Tomas Neme
Anyone knows of any trick that will let me show a second-level indirection inline via a one2one, so ModelA <-FK- ModelB <-one2one- ModelC, and show A, B-C-B-C-B-C kind of thing? Maybe I can override the get_formsets in the admin? -- "The whole of Japan is pure invention. There is no such countr

Re: DRYing up my forms.py

2012-08-04 Thread Tomas Neme
But if you subclass the widget, then you'll need to override every form's widget with { forms.DateField: MyDateWidget } so overriding and using your own MyDateField would be less verbose and repetitive On Sat, Aug 4, 2012 at 6:17 PM, Melvyn Sopacua wrote: > On 3-8-2012 18:23, Lee Hinde wrote:

Re: How to override an attribute?

2012-08-05 Thread Tomas Neme
> There is a class (let's call it Foo) which is a subclass of User. > Foo has the following line in its Meta: > proxy = True if you don't provide full minimal data, it's hard for us to help. If I had known you were using a proxy model, I'd have proposed something different. In general, unless you

Re: How to override an attribute?

2012-08-05 Thread Tomas Neme
I don't mean to say you shouldn't need to ask questions, I just say that using or not "proxy" is not a "let's see what happens" choice, and having the docs read and halfway understood will help you ask *the right* questions -- "The whole of Japan is pure invention. There is no such country, there

Re: multiple profile

2012-08-14 Thread Tomas Neme
Well, it depends on what you want to do exactly, you could create something like this: class UserProfile(models.Model): common_data class ClientProfile(UserProfile): specific_data class StudentProfile(UserProfile): specific_data class TeacherProfile(UserProfile): spe

Re: Hot to use widgets with generic views

2012-08-14 Thread Tomas Neme
well, for starters, you won't magically get "on keyup" behavior by adding something on your backend, you'll need to use ajax for this, and, depending on your expected number of elements, it might be better to send everything and do any filtering on the client side (if you're handling, say, up to a

Re: New to dj: relational limitations

2012-08-15 Thread Tomas Neme
> On Tue, Aug 14, 2012 at 8:49 PM, Russell Keith-Magee > wrote: I'm just glad I didn't come back with a half-assed response -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy an

Re: How well does South work in a team?

2012-08-16 Thread Tomas Neme
Well, if you push without pulling, this might happen, if you always pull before pushing, then you'd have to manually merge both migrations (which would probably mean letting the other migration as 001, and changing yours so it adds your wanted changes on top of THAT And as an answer: using south i

Re: How well does South work in a team?

2012-08-16 Thread Tomas Neme
>> Well, if you push without pulling, this might happen, > > *Implicit git usage* :D Implicit VCS usage, whichever you choose. If you don't, you shouldn't be doing team work -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_

Re: How well does South work in a team?

2012-08-16 Thread Tomas Neme
>>> Well, if you push without pulling, this might happen, >> >> *Implicit git usage* :D > > Implicit VCS usage, whichever you choose. > > If you don't, you shouldn't be doing team work ah, I see now. CVS wouldn't complain in that scenario... neither would git/hg when you pull, for that case.. yes

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Tomas Neme
DropDownMultiple widget http://djangosnippets.org/snippets/747/ -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. --

Re: django makemessages doesn't recognize trans in templates

2012-08-17 Thread Tomas Neme
> For example for this link > > {% trans "contacts" %} > > I have the msgstr="Contactos". I expect to see "Contactos" in the browser, > but I still see "contacts". Any suggestion? 1) case-sensitive. Are you sure you haven't translated "Contacts" instead of "contacts"? 2) fuzzy-mark. I've noticed t

Re: [old question]NoReverseMatch.. I am sorry.

2012-08-17 Thread Tomas Neme
either remove the quotes from {% url 'blog.views.add_comment' %} (so it's {% url blog.views.add_comment %}) or {% load url from future %} Loading from future is the better option, I think. and for future reference: Reverse for ''blog.views.add_comment'' with arguments '(1L,)' and keyword argume

Re: [old question]NoReverseMatch.. I am sorry.

2012-08-17 Thread Tomas Neme
> But I am confused. > For example, > the following code needs to add single quote. > > {% block content %} > Add Todo items https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi also, that won't work with double quotes either, unless you import future, and a bunch of other t

Re: Full auth solution

2012-08-17 Thread Tomas Neme
> http://www.django-userena.org/ ++ I've successfully combined it with django-social-auth to have facebook/twitter/google/openId login -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny

Re: Hard time debugging an strange problem

2012-08-31 Thread Tomas Neme
I'd like to see some of your management commands' code. It smells somewhat like you're running a shell subprocess and not waiting for it to be done before going on to the next thing -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|

Re: To Use or Not to Use the admin backend

2012-09-04 Thread Tomas Neme
> Anyway, to the question. Once the models, the intermediate models and > the interactions between all of them start getting sufficiently > complex, you will need to put new forms on front. Theoretically, you I've a question about this. I tried to do something like this, but using the main capabil

Django-admin (was: tastypie - some feedback / comments)

2012-09-12 Thread Tomas Neme
Since this came up, are there any more-or-less packaged alternatives to django-admin? More than twice I've had to give up in something as simple as rendering two-level FK indirections, lest I wanted to override most of the ModelAdmin classes. The thing is that I don't trust myself to be throughout

Re: Django-admin (was: tastypie - some feedback / comments)

2012-09-12 Thread Tomas Neme
The admin templates and views themselves are convoluted enough (the price of having them work with anything), and full of enough magic that it's not really feasible to build on top of them to add the required capabilities. Maybe adding new admin views would be a posibility, but what happens when yo

Re: OR together multiple extra clauses

2012-09-14 Thread Tomas Neme
I haven't done this, so I might be wrong, but... > queryset.extra( > where=['unaccent("table_name"."column_name"::text) LIKE > unaccent(%s)'], > params=['%%%s%%' % value] > ) first, wouldn't just setting params=[value] work? furthermore, isn't that the whole point of the p

Re: Django: language in field description in forms won't change

2012-09-22 Thread Tomas Neme
you probably are using ugettext and should be using ugettext_lazy On Sat, Sep 22, 2012 at 8:44 PM, Patrick wrote: > When I change language on my Django-powered site, everything works fine > except the translation of the field descriptions in the forms. The > description is still displayed in the

Re: Making form label a href

2012-09-30 Thread Tomas Neme
> Is there some way to have the form label be a href? you'll have to change the forms templates to something like {% for field in form %} {{ field.label }} {{ field }} {% endfor %} -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde

Re: Facebook like button in django

2012-10-11 Thread Tomas Neme
You should probably start by reading this: http://developers.facebook.com/docs/reference/plugins/like/ -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") t

Re: Facebook like button in django

2012-10-12 Thread Tomas Neme
> I want to create a website facebook like, but real simple and I want to have > a button that I can give to blogger to add them on their blog entries. It > have nothing to do with facebook. Ah! so you want your own "facebook button"! It'll be mostly a javascript task, rather than django-specifi

Re: implement of view

2012-10-24 Thread Tomas Neme
> > how can i implements now these "def sql(request):" into my html code? pls > help me... > you're saying next to nothing, but I *guess* you could do something like return render_to_response("sql.html", { 'row': row }) at the bottom of your sql view, and write an sql.html template that shows it

Re: implement of view

2012-10-24 Thread Tomas Neme
>> Thank you for your answer. i have chapter 1-4 of >> http://www.djangobook.com/en/2.0/index.html done, but not much time to go >> throught the hole book atm. i will try it with your code. :) the django book is somewhat outdated, and long. https://docs.djangoproject.com/en/dev/intro/tutorial01/

Re: Displaying a custom field (PickledObjectField) in the admin

2012-10-24 Thread Tomas Neme
maybe restate the problem, give some more code, show your models, and your admin files, and someone may be able to help a little -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy

Re: Displaying a custom field (PickledObjectField) in the admin

2012-10-24 Thread Tomas Neme
be ANYTHING On Wed, Oct 24, 2012 at 3:03 PM, Tomas Neme wrote: > maybe restate the problem, give some more code, show your models, and > your admin files, and someone may be able to help a little > > -- > "The whole of Japan is pure invention. There is no such country, t

Re: implement of view

2012-10-25 Thread Tomas Neme
>>> How can i create 2 views on one page? >>> def sql(request): and def portal(request): You can't. A View *is* a page. Do the tutorial. You could use class-based views and have a view that inherits from both, and combines the contexts (this is _not_ in the tuto) -- "The whole of Japan is pure i

Modernizing the Tutorial

2012-10-25 Thread Tomas Neme
Now that function-based views are being deprecated, or at least that class-based views are being favored, there should be a tutorial with them in the docs, shouldn't it? I don't mean replacing the current one, because that'd raise the entry point a lot, but cloning the original tutorial, but imple

Re: Modernizing the Tutorial

2012-10-25 Thread Tomas Neme
> However, there is also scope for a focussed tutorial about class-based views > in general. IMHO one of the biggest uptake problems around class-based This is what I meant. Something that brings in, easy and clearly, the concept of mixins, the different mixins,something that, for example, take tw

Re: 1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Tomas Neme
> Thanks, yup! I just figured it out too. I didn't realize all the "apps" are > in the path as well. the apps aren't NECESSARILY in the path. Django has a concept of app label, which is the name of the directory where the models module exists. For example, django-cms has plugins, which in order t

Re: Django URL pattern - template tags

2011-09-02 Thread Tomas Neme
I'll still answer this just in case. You should have the following in your urls.py: urlpatterns += (.., url(r'(P)\w+/(P)\d+/(P)\[w-]+/', your_view, name='yoururlname'), ) and then you can have in your template {{ n.title }} I hope I didn't make any mistakes. tomas -- "The whole of

Re: Too many TCP connections

2011-09-02 Thread Tomas Neme
shot in the dark: aren't they connections to the database, maybe? On Sat, Sep 3, 2011 at 12:56 AM, shacker wrote: > Hmm, appreciate the feedback, but we don't have KeepAlives enabled on our > Django servers and it's never been a problem. And remember, the other Django > site on the same server do

Re: Initial data for ManyToMany field

2011-09-06 Thread Tomas Neme
Look into formsets. It's what the admin inlines use. On Tue, Sep 6, 2011 at 5:40 PM, Nan wrote: > > Because SymptomeForm is a ModelForm, it will initialize its "parent" > field as a ModelMultipleChoiceField, which I believe must be > initialized with a queryset instead of a list. > > On Sep 6, 4

Re: Initial data for ManyToMany field

2011-09-06 Thread Tomas Neme
> Look into formsets. It's what the admin inlines use. that is class TypeMedicalForm(forms.ModelForm): class Meta: model = TypeMedical TypeMedicalFormSet=formset_factory(TypeMedicalForm) take a look at the django docs for more details -- "The whole of Japan is pure invention. There is no

  1   2   >