Dynamic models

2023-05-22 Thread ruth salvatore
Here I am creating django dynamic models but for getting data i am using get method but i am not getting data it just says that table does not exist even if it is present. from django.http import JsonResponse from.serializers import CreateTableSerializer from django.db import connection,

Re: dynamic django tables

2023-05-22 Thread ruth salvatore
it worked for me thanks.but if someone wants to add constraints like primary key,Foreign key and many more then how to do it. On Monday, May 22, 2023 at 10:59:08 AM UTC+5:30 Brian Gitau wrote: Try this i am not so sure though but trying isn't bad...kindly give me the feedback after trying

django with nginx in CentOS 7

2021-01-21 Thread Salvatore Aurnia
Hi, I deployed a project in a server CentoOS7 and I'm using gunicorn and nginx, I have configureated the .conf file and the nginx service is started correctly, but from browser the html page "Welcome to CentOS 7" is showed. How Can I resolve this? Thanks, Salvo -- You received this message

Re: settings.py variables in fixtures

2015-12-28 Thread Salvatore Scaramuzzino
your support. Il giorno lunedì 28 dicembre 2015 01:19:05 UTC+1, Russell Keith-Magee ha scritto: > > Hi Salvatore, > > On Mon, Dec 28, 2015 at 12:09 AM, Salvatore Scaramuzzino < > salvatores...@gmail.com > wrote: > >> hi to everyone >> >> i'm newbye in dja

settings.py variables in fixtures

2015-12-27 Thread Salvatore Scaramuzzino
hi to everyone i'm newbye in django, but i really appreciate this useful framework. I have a simple question but i don't know if is appropriate. i have a fixture written in JSON and i use it to provide initial data to my webapp. i want to provide in this fixture absolute paths in order to

Re: Accessing request object

2014-09-22 Thread Salvatore DI DIO
o you can consider adding request parameter explicitly to your > __init__ method and then passing it to `restrictQuery`. > > PS. restrictQuery should be named restrict_query according to python > style guide. > > воскресенье, 21 сентября 2014 г., 15:38:23 UTC+4 пользователь Sa

Re: Accessing request object

2014-09-22 Thread Salvatore DI DIO
Excuse me Collin, I don't understang what you are meaning ... Le lundi 22 septembre 2014 17:46:41 UTC+2, Collin Anderson a écrit : > > Can you attach the request to `form.request`? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Testting field.label_tag

2014-09-22 Thread Salvatore DI DIO
ers > > > On Monday, September 22, 2014 10:51:59 AM UTC+2, Salvatore DI DIO wrote: >> >> Hello, >> >> I woulk like to test field.label_tag in the fieldset.html template >> >> For example I want to do: >> >> {% if field.label_tag != 'Tags' %} &

Re: Testting field.label_tag

2014-09-22 Thread Salvatore DI DIO
Cheers > > On 22 Sep 2014, at 10:51, Salvatore DI DIO <salvato...@gmail.com > > wrote: > > Hello, > > I woulk like to test field.label_tag in the fieldset.html template > > For example I want to do: > > {% if field.label_tag != 'Tags' %} > {{ f

Testting field.label_tag

2014-09-22 Thread Salvatore DI DIO
Hello, I woulk like to test field.label_tag in the fieldset.html template For example I want to do: {% if field.label_tag != 'Tags' %} {{ field.label_tag }} {% endif %} But that seems to not work Thanks for your suggestions -- You received this message because you are subscribed to

Solution : filtering listbox per user in 'admin add' form

2014-09-21 Thread Salvatore DI DIO
This post follows my previous on filtering a listbox in 'admin add form' per user This is ceratinly a hack but It works for now, If you have a better solution, I would be glad to read it. In order to access the request object in '*/contrib/admin/helpers.py*' I modified the

Re: Custom change_form.html

2014-09-21 Thread Salvatore DI DIO
the albums created by the connected user Regards Le dimanche 21 septembre 2014 15:38:39 UTC+2, Alex Chiaranda a écrit : > > Hi Salvatore, > > in your admin.py you can redefine your get_queryset and do something like > this: > > > class FooAdmin(admin.ModelAdmin): >

Accessing request object

2014-09-21 Thread Salvatore DI DIO
Hello, Is it possible to access request object in 'helpers.py' file ? Ihave tried 'crequest' (from crequest.middleware import CrequestMiddleware) without luck. class AdminField(object): def __init__(self, form, field, is_first): self.field = form[field] # A django.forms.BoundField

Re: Custom change_form.html

2014-09-21 Thread Salvatore DI DIO
Thank you Collin, In fact I have not really access to the list. II would like to flter a list wich is already rendered as a listbox widget (fiedset.html) Le samedi 20 septembre 2014 01:33:42 UTC+2, Collin Anderson a écrit : > > if nothing else: > > {% for item in list %}{% if item.user = user

Custom change_form.html

2014-09-19 Thread Salvatore DI DIO
Hello, *To follow my preceding question, on customize admin view, (*Helton Alves gave me a nice response). I am wondering how to filter a list in change_form.html admin form, according to a partuculiar user ? Thank you for your help Regards -- You received this message because you are

Re: Customise admin view

2014-09-18 Thread Salvatore DI DIO
.user) > > > 2014-09-18 14:17 GMT+01:00 Salvatore DI DIO <salvato...@gmail.com > >: > >> Hy Elton, >> >> In fact each image belongs to an album. >> Let us say I have three album ALB1 ALB2 ALB3 >> >> In the admin form, when I add an image I

Re: Customise admin view

2014-09-18 Thread Salvatore DI DIO
t; 2014-09-18 9:59 GMT+01:00 Salvatore DI DIO <salvato...@gmail.com > >: > >> Hello, >> >> I am following a 'photo application' tutorial : >> http://lightbird.net/dbe/photo.html >> I have created several 'albums' to insert images in. >> &

Customise admin view

2014-09-18 Thread Salvatore DI DIO
Hello, I am following a 'photo application' tutorial : http://lightbird.net/dbe/photo.html I have created several 'albums' to insert images in. I would like those albums beeing displayed in the admin panel according to each user or group Thank your for your help regards -- You received

Localization of text in a variable

2012-06-19 Thread Salvatore Iovene
Hi, I'm having the following code: Models: untranslated = "Foo" translated = ugettext(untranslated) # Hopefully "makemessages" will read this insert_in_database(untranslated) Later in a View: text = get_from_database(); And I pass it to a template where I do: {% trans text %} This is not

Setting a GenericForeignKey results to a FieldNotFoundError

2012-06-10 Thread Salvatore Iovene
Hi, I'm using django-reviews in my site. Sometimes, reviewed items will be merged by an admin, so, whenever I merge Item B to Item A, I also move all the reviews of B to A. I do it this way: ReviewedItem.objects.filter(gear =

Re: How do I sort choices by their localized label?

2012-02-11 Thread Salvatore Iovene
*args, > **kwargs) > self.fields['country_field'].choices = sorted(COUNTRIES, > key=lambda c: c[1]) Funny, that fixes it. Thanks! It's a layer violation, so I have to do it for each form that uses my field, but it works. Salvatore. -- You received this message because you a

How do I sort choices by their localized label?

2012-02-11 Thread Salvatore Iovene
lish names, whatever the locale. I can't switch to ugettext instead of the _lazy version, because this is a Field so it won't work at all. Do you have any suggestion on how to get my list of countries properly sorted in all locales? Thank you! Salvatore Iovene. -- You received this message b

Please help with complex aggregation/annotation issue

2012-01-18 Thread Salvatore Iovene
highest nomination counts for both). Can anybody please help with this? Thanks in advance, Salvatore. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-

Re: What server configuration should I use for a Django site like this?

2011-11-30 Thread Salvatore Iovene
Hi, I recently launched a Django project on a Linode 1024. I serve django with nginx, run mysql, and a bunch of other stuff. I routinely have about 500MB of free RAM. I wouldn't recommend a Linode 512, you will swap a lot. -- You received this message because you are subscribed to the Google

Re: Delete a many to many field who is in another table

2011-11-30 Thread Salvatore Iovene
Hi, after: exp.experimentos.remove(request.POST.get('experimentosDelete')) You should do: exp.save() I hope this helps. Salvatore. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web vi

Re: I18N and caching: page don't change language until I press F5 in browser

2011-11-05 Thread Salvatore Iovene
like fixing a headache with a guillotine. The browser should cache it's own version whenever possible, even though we're caching server side with memcached. -- Salvatore Iovene http://www.google.com/profiles/salvatore.iovene -- You received this message because you are subscribed to the Google Groups

Re: I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
On Friday, November 4, 2011 5:31:46 PM UTC+2, Salvatore Iovene wrote: > > if hasattr(request, 'session'): > request.session['django_language'] = lang > else: > response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang) > I have solved my

Re: I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
PS: I have also tried the @vary_on_header('Accept-Language') decorator, but unfortunately that didn't help either. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
) if request.user.is_authenticated(): profile = UserProfile.objects.get(user = request.user) profile.language = lang profile.save() return response I have tried changing the order of the middleware, but to no avail. Can somebody please help? Thanks! Salvatore. -- You

Re: How to save data in the model in the second step of a 2-step form?

2010-12-06 Thread Salvatore Iovene
On Dec 6, 6:09 pm, Wayne Smith wrote: > > After the second form is done and valid, I would like to save the > > information that comes to it to Image, in the same row that has the id > > I was passing. > > > How can I do this? > > image.description = information user

How to save data in the model in the second step of a 2-step form?

2010-12-06 Thread Salvatore Iovene
Hi, I'm doing a 2-step form, so that in the first step, the user will upload an image, and in the second step, she will fill in some details about it. My problem is that after the second step, the data is not saved in the model. Here's some relevant code. The model: class Image(models.Model):

Re: apache ok (mod_wsgi) bue some issue with admin backend

2009-08-05 Thread Salvatore Leone
o derive the initial portion of the hostname for media links, >> unless you've done something really customised in your model's file >> fields. >> You're right. I forgotten about this... thanks again. Regards, Salvatore --~--~-~--~~~---~--~-

apache ok (mod_wsgi) bue some issue with admin backend

2009-08-05 Thread Salvatore Leone
Hello again... I have my site working with mod_wsgi, but I still have some problem using the admin interface and managing uploaded files. On the admin side all static files aren't loaded. So there is no css and you can imagine the way I see the admin pages... I also have some problem

Re: apache

2009-08-05 Thread Salvatore Leone
If I could use that server would not need apache at all. -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com

Re: apache

2009-08-04 Thread Salvatore Leone
til I run it with "python2.5 manage.py . Is there a way to tell mod_python to user python2.5 instead of 2.6?? -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: apache

2009-08-04 Thread Salvatore Leone
Graham Dumpleton ha scritto: > > On Aug 4, 8:42 pm, Salvatore Leone <salvatore.le...@isti.cnr.it> > wrote: > >> Hi, >> >> I'm trying to move my site from the developemente server to Apache but I >> always obtain this error: >> >> Impo

apache

2009-08-04 Thread Salvatore Leone
d be wrong? I tryend to put: SetEnv DJANGO_SETTINGS_MODULE /home/testpec/public_html/pecwizard/settings.py but it says something about I can't set the variable with a full path to the settings.py file -Salvatore --~--~-~--~~~---~--~~ You received this message b

[solved] processing html arrays

2009-07-31 Thread Salvatore Leone
Salvatore Leone ha scritto: > Hi, > > I've a form with a html array. How can I process this array in my view > after the submit? > > I'm pretty sure the html code is correct because I can manage the array > with a php script... so there must be a way to do it in p

processing html arrays

2009-07-31 Thread Salvatore Leone
Hi, I've a form with a html array. How can I process this array in my view after the submit? I'm pretty sure the html code is correct because I can manage the array with a php script... so there must be a way to do it in python. -Salvatore

dynamic form

2009-07-31 Thread Salvatore Leone
my questin is: do I have to manualy import jquery in my template or there some "django way" for doing it? --Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

MEDIA_URL MEDIA_ROOT

2009-07-30 Thread Salvatore Leone
the files returns me a 404 error. I can workaround this configuring urls.py for serving static files. Is this the right way to do it?? regards, Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

[SOLVED]Re: dictionaries in template

2009-07-30 Thread Salvatore Leone
> {% for answer,value in answers_list.items %} > > it works, thanks! -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

dictionaries in template

2009-07-30 Thread Salvatore Leone
ach list, right? {% for attach in answer_list.answer %} # use the attach # but nothing happens! {% endfor %} any idea? -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

[solved]Re: file upload issue

2009-07-29 Thread Salvatore Leone
Again I found the answer... I forgot to put enctype="multipart/form-data" in my form... sorry for disturbing you. -S Salvatore Leone ha scritto: > Hello again, > > I know this is probably an already discussed question, but I can't get > out of this. I've got a form whi

file upload issue

2009-07-29 Thread Salvatore Leone
') risposta = models.ForeignKey(Risposte) the problem is that *never* saves an attach. any idea? -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: [solved]Re: test if GET is "empty"

2009-07-29 Thread Salvatore Leone
o the test will allways return true for a GET request. -Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

[solved]Re: test if GET is "empty"

2009-07-29 Thread Salvatore Leone
there is some variable > (like user_id='2') I can process the request and do something with > theese variables. > > > Is there any way or do I have to test for every single variable? > > You know, it's boring to write "if request.GET['var1'] and > re

test if GET is "empty"

2009-07-29 Thread Salvatore Leone
variable? You know, it's boring to write "if request.GET['var1'] and request.GET['var2'] and ..." Regards, Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

iterating through user.groups

2009-07-27 Thread Salvatore Leone
any idea? Regards Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, s

form and hidden input with user id

2009-07-27 Thread Salvatore Leone
is good, but it creates multiple choice for the author_id field. Is there anyway for changing this behaviour and automatically fill this field with the user id? Is it correct to manually create a hidden field with the user.id value? Regards, Salvatore

cgi handlers

2006-11-06 Thread Salvatore
Hello, Can someone explain me how to use the cgi's handler found in http://code.djangoproject.com/ticket/2407 Regards Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Django - CGI

2006-11-04 Thread Salvatore
Grazie Antonio :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Django - CGI

2006-11-04 Thread Salvatore
I have follow the "polls" tutorial in /home/Salvatore/www/mysite which contains : -rw-r--r-- 1 Salvatore Salvatore0 2006-11-05 00:17 __init__.py -rw-r--r-- 1 Salvatore Salvatore 118 2006-11-05 00:18 __init__.pyc -rwxr-xr-x 1 Salvatore Salvatore 546 2006-11-05 00:17 manage.py

Re: manage.py

2006-11-04 Thread Salvatore
I've downloaded the 0.95 and it is ok now Thank you again Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: manage.py

2006-11-04 Thread Salvatore
Verssion 0.90 the command is : django-admin.py startproject mysite Thanks for your response --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

manage.py

2006-11-04 Thread Salvatore
Hello, When I create a new project the file manage.py is not created Can someone explain me why ? Regards Salvatore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to