How to save last IP address of admin user on administration page?

2022-03-01 Thread Edo
Hi guys, I'm trying to find a way to save last admin IP address in the admin panel and open a popup on login if the admin IP address is different from the last one saved. Any tips? -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: How to save a result of multiplication

2021-04-26 Thread Roberth Solis Martínez
I'm according with Derek, but I saw you have a mix of languages and method, spanish and english, I'm speak spanish too, but as a best practice and prevent mix langagues try to use english, you know is like a standard or best practice in latin America El lunes, 26 de abril de 2021 a las

Re: How to save a result of multiplication

2021-04-26 Thread Derek
I think you have used the wrong name - "saveit" instead of "save" - also have a look at the example in the docs: https://docs.djangoproject.com/en/3.2/topics/db/models/#overriding-predefined-model-methods and see which parameters are needed for it. On Saturday, 24 April 2021 at 20:50:15 UTC+2

How to save a result of multiplication

2021-04-24 Thread jose angel encinas ramos
Hi everyone i build a web application in Django 3.1.7 and i try to do the next opeation(multiplication). in my models a have: class Articles(models.Model): quantity = models.PositiveIntegerField() cost_buy = models.DecimalField(max_digits=10, decimal_places=2) total_todo =

Re: How to save all fields in form in single row into the database.

2020-11-23 Thread Naresh Jonnala
For your reference: https://docs.djangoproject.com/en/3.1/ref/forms/api/#django.forms.Form.prefix On Monday, November 23, 2020 at 6:06:46 PM UTC+5:30 sali...@rohteksolutions.com wrote: > Hi, > > We are trying to save fields in html form into one row into a database. > > models.py > > class

How to save all fields in form in single row into the database.

2020-11-23 Thread Salima Begum
Hi, We are trying to save fields in html form into one row into a database. models.py class master(models.Model): STATUS = ( ('1', 'Active'), ('0', 'InActive'), ) question_code = models.IntegerField() question_description = models.CharField(max_length=160)

Re: How to Save or Print the array field in Django using CreateView?

2020-10-11 Thread Venkata Rami Reddy Kasu
Don't spam the community. Advertise yourself outside the group. .. Thank you *K.V.Rami ReddyPHP , Node.Js & Python Web Developer* On Sun, 11 Oct 2020 at 22:41, Dvs Khamele wrote: > Hi do you hire contract based

Re: How to Save or Print the array field in Django using CreateView?

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Sun, 4 Oct 2020, 11:39 pm Kasper Laudrup, wrote: > Hi Janak, > > On 04/10/2020 08.59,

Re: How to Save or Print the array field in Django using CreateView?

2020-10-04 Thread Kasper Laudrup
Hi Janak, On 04/10/2020 08.59, Janak Parmar wrote: Please help me here. I want to convert this array field values into string with comma separated and then save in table. Not sure what "this array" is in this context, but couldn't you just use the standard Python join method?

How to Save or Print the array field in Django using CreateView?

2020-10-04 Thread Janak Parmar
Hi PFB the code. HTML Array of Input Field Model.py Models.py Image Forms.py Forms.py Image Views.py Views.py Image Please help me here.

Re: How to save images posted by application users

2020-07-18 Thread Liu Zheng
Hi. Here's a very nice video tutorial on how to handle images with media. https://www.youtube.com/watch?v=FdVuKt_iuSI=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p=8 Also to your question on how to deploy it in production, check this video.

Re: How to save images posted by application users

2020-07-17 Thread Mottaz Hegaze
Try to use subfolder in media, upload_to='/images' On Fri, 17 Jul 2020, 7:18 am Exactly musty, wrote: > I also had the same problem long time ago I remember i felt like hanging > myself,here is what I did, i deleted the media folder,created by django, > try this if it will work > > -- > You

Re: How to save images posted by application users

2020-07-16 Thread Exactly musty
I also had the same problem long time ago I remember i felt like hanging myself,here is what I did, i deleted the media folder,created by django, try this if it will work -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: How to save images posted by application users

2020-07-16 Thread Ram
Hi Mottaz, Thank you for your suggestion. We already tried a model with ImageField but not luck yet. Here is our code snippet image = models.ImageField(upload_to='media', > null=True, blank=True) image2 = models.ImageField(upload_to='media', > null=True, blank=True) image3 =

Re: How to save images posted by application users

2020-07-16 Thread Mottaz Hegaze
You need a model with ImageField or FileField On Thu, 16 Jul 2020, 7:07 am Ram, wrote: > Hi, > > We need to save images posted by our application users and the images will > be displayed in application UI once they are saved successfully. We are > trying with these parameters in our settings.py

How to save images posted by application users

2020-07-15 Thread Ram
Hi, We need to save images posted by our application users and the images will be displayed in application UI once they are saved successfully. We are trying with these parameters in our settings.py but they are not working and our OS platform is Windows 10 OS. We know file paths are different in

Re: how to save multiple checkbox values and checked status(true or false) in the django....

2020-05-14 Thread Kasper Laudrup
On 14/05/2020 14.42, frontend developer wrote: thanks very much for your replyi want to how to store the check box value and checked state in the django..can help on this So what have you tried so far and where are you facing issues? Kind regards, Kasper Laudrup -- You received this

Re: how to save multiple checkbox values and checked status(true or false) in the django....

2020-05-14 Thread frontend developer
thanks very much for your replyi want to how to store the check box value and checked state in the django..can help on this On Thursday, May 14, 2020 at 4:58:37 PM UTC+5:30, Kasper Laudrup wrote: > > On 14/05/2020 03.42, frontend developer wrote: > > Hello, i am beginner to django, i am

Re: how to save multiple checkbox values and checked status(true or false) in the django....

2020-05-14 Thread Kasper Laudrup
On 14/05/2020 03.42, frontend developer wrote: Hello,  i am beginner to django, i am sending values and checked status from the front end using checkboxesnow i do not no how to write frame work in the django, can i get any help on these Start by completing the official Django

how to save multiple checkbox values and checked status(true or false) in the django....

2020-05-13 Thread frontend developer
Hello, i am beginner to django, i am sending values and checked status from the front end using checkboxesnow i do not no how to write frame work in the django, can i get any help on these -- You received this message because you are subscribed to the Google Groups "Django users"

How to save an array of text in PostgreSQL using Django model.?

2019-08-19 Thread Shafay Haseeb
I have asked this question on StackOverflow here, https://stackoverflow.com/questions/57547588/how-to-save-an-array-of-text-in-postgresql-using-django-model but havent received any input. My question is simple, how to store a list in django postgresql model. You could refer to my link above

How to save bio using forms.ModelForm

2019-01-27 Thread Arturo Fernandez
I tried multiple links on stackov. but none worked, I can't get my *bio* form to save the data on the db for the user profile :/ I managed to save the first name and last name, but I can't make the bio save... This is my code: *profile.html* {% csrf_token %} {{ user_BioAndSocialForm.bio

Re: How to save multiple model form in one template?

2018-10-13 Thread Ing.Daniel Bojorge
rm are many models >> >> DJANGO 2.1 https://goo.gl/oeT5Sx >> >> El viernes, 7 de septiembre de 2018, 4:43:11 (UTC-6), Django Lover >> escribió: >>> >>> >>> I have one page, which I have to show three model form and three >>> dif

Re: How to save multiple model form in one template?

2018-10-13 Thread Joel Mathew
ent submit button for each. >> >> My question is how I can save these three form individually? >> >> FOLLOWING IS CODE:- >> >> **form.py** >> >> >> class UserTaxesMultiForm(MultiModelForm): >>form_classes = { >>'us

Re: How to save multiple model form in one template?

2018-10-13 Thread Daniel Bojorge (Foros)
how three model form and three > different submit button for each. > > My question is how I can save these three form individually? > > FOLLOWING IS CODE:- > > **form.py** > > > class UserTaxesMultiForm(MultiModelForm): >form_classes = { >'user_ta

Re: How to save multiple model form in one template?

2018-09-19 Thread Sunil Kothiyal
HI Everett White , Please suggest solution i am trying since 3 days, I want Django model update if exist. I will very thankful to you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Re: How to save multiple model form in one template?

2018-09-19 Thread Everett White
Hey y’all -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: How to save multiple model form in one template?

2018-09-11 Thread Devender Kumar
,etc...] >>> >>> class DaysForm(forms.Form): >>> OPTIONS = ( >>> ("Sunday", "Sunday"), >>> ("Monday", "Monday"), >>> ("Tuesday", "Tuesday"), >>>

Re: How to save multiple model form in one template?

2018-09-09 Thread Sunil Kothiyal
("Tuesday", "Tuesday"), >> ("Wednesday", "Wednesday"), >> ("Thursday", "Thursday"), >> ("Friday", "Friday"), >> ("Saturday", "Saturday"

Re: How to save multiple model form in one template?

2018-09-08 Thread Savvey Chauhan
it would be easier to write out a custom form (without using your >> model classes, just the fields that you will need for all the models) and >> then in the save method for that form's view, you create model objects >> using the fields in the POST request. &

Re: How to save multiple model form in one template?

2018-09-07 Thread Anthony Petrillo
sing your > model classes, just the fields that you will need for all the models) and > then in the save method for that form's view, you create model objects > using the fields in the POST request. > > On Friday, September 7, 2018 at 5:43:11 AM UTC-5, Django Lover wrote: >

Re: How to save multiple model form in one template?

2018-09-07 Thread Akshay Gaur
:11 AM UTC-5, Django Lover wrote: > > > I have one page, which I have to show three model form and three > different submit button for each. > > My question is how I can save these three form individually? > > FOLLOWING IS CODE:- > > **form.py** > > >

Re: How to save multiple model form in one template?

2018-09-07 Thread Sunil Kothiyal
Do you have something to save multiform using by one view?/ On Fri, Sep 7, 2018 at 5:33 PM Elphas Rop wrote: > you make the 3 forms then make a view for saving each form then url for > each them then in each form action add a url to the view responsible for > saving it > > On Fri, Sep 7, 2018,

Re: How to save multiple model form in one template?

2018-09-07 Thread Elphas Rop
you make the 3 forms then make a view for saving each form then url for each them then in each form action add a url to the view responsible for saving it On Fri, Sep 7, 2018, 14:27 Elphas Rop wrote: > >> >>> tax_rate = forms.FloatField(required=True, label="tax rate") >>> >>> >>>

Re: How to save multiple model form in one template?

2018-09-07 Thread Sunil Kothiyal
different submit button for each. >> >> My question is how I can save these three form individually? >> >> FOLLOWING IS CODE:- >> >> **form.py** >> >> >> class UserTaxesMultiForm(MultiModelForm): >>form_classes = { >>

Re: How to save multiple model form in one template?

2018-09-07 Thread Mohammad Aqib
Show your models.py. On Fri, Sep 7, 2018 at 4:13 PM Django Lover wrote: > > I have one page, which I have to show three model form and three > different submit button for each. > > My question is how I can save these three form individually? > > FOLLOWING IS CODE:- > &

How to save multiple model form in one template?

2018-09-07 Thread Django Lover
I have one page, which I have to show three model form and three different submit button for each. My question is how I can save these three form individually? FOLLOWING IS CODE:- **form.py** class UserTaxesMultiForm(MultiModelForm): form_classes = { 'user_tax_form': MyForm

Re: Unable to Save form to mysql - How to save form field values to mysql database and get the value from database

2018-07-02 Thread Andréas Kühne
In your views file, you don't have any index method - that's what the error is saying. So you need to solve the url mapping for your index method. Regards, Andréas 2018-07-02 5:55 GMT+02:00 Tamilvanan Anbalagan : > Hi Team, > > I am very new to django framework, iI am trying to using simple

Unable to Save form to mysql - How to save form field values to mysql database and get the value from database

2018-07-02 Thread Tamilvanan Anbalagan
Hi Team, I am very new to django framework, iI am trying to using simple forms to save into mysql database. also any samples pls send it to me, which will help to understand the connectivity. *see my sample code:* *views.py* from django.http import HttpResponseRedirect from django.views

Re: How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Constantine Covtushenko
Hi, Can you please describe why you did not want to call author.save() explicitly? What is wrong with this approach? Regards, Constantine C. On Mon, Dec 4, 2017 at 7:36 PM, Priyanka Thakur wrote: > Hi, > > > I want to create a bunch of objects that are interconnected

How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Priyanka Thakur
Hi, I want to create a bunch of objects that are interconnected in my model (eg, one Book and one Author object) and then call save() on the Book object to add everything to the database. In other words, I don't want to save Author object explicitly. Example: class Author(models.Model):

How to save user permissions from custom user edit form

2017-11-04 Thread DJ-Tom
Hi, I have created the following user form for my custom user model: class UsersForm(ModelForm): class Meta: model = UserAccount fields = ('is_active', 'is_superuser', 'is_templog', 'is_crewreg', 'is_spaceman','first_name', 'last_name', 'company',

Re: How to save an invoice document with new record creation in the database

2017-08-16 Thread Alexander Joseph
Thanks for the advice Derek. I actually had just moved the docx creation to the save method after I posted my question yesterday, and you're right, it works much better there On Wed, Aug 16, 2017 at 2:56 AM, Derek wrote: > You may want to initiate the .docx creation via a

Re: How to save an invoice document with new record creation in the database

2017-08-16 Thread Derek
You may want to initiate the .docx creation via a trigger in the post_save function; see: https://docs.djangoproject.com/en/1.11/ref/signals/#post-save Also, I would move the "utility" code for creating the invoice number into a separate function, as its easier to test and (possibly) call

How to save an invoice document with new record creation in the database

2017-08-14 Thread Alexander Joseph
Hello, I have an app for creating invoices, but I'd like to be able to save a .docx of the invoice when the user creates the invoice (I'm using docx library). I'm very new to django so any direction you can give I appreciate. I'd like to know the proper way to go about doing this. Right now I

How to save images present in Django application directory to models

2016-09-22 Thread Krishn Bera
I am making a Django application that will do some sort of image manipulation. As an intermediate step, I am generating new images in the Django application directory. Now I want to save these images(.jpg) to a model that contains ImageField. How should I go about saving this image in

Re: How to save one field value from a model to another field of a linked model.

2016-08-17 Thread Fred Stluka
Md. Ohiduzzaman, Looks good so far.  What happens when you try it? --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristle Software, Inc -- http://bristle.com -- Glad to be of service!

Re: How to save one field value from a model to another model field

2016-08-17 Thread Vinicius Assef
Your method get_shift_date() has a syntax error. Your save() method has identation problem. Please correct them and send us the right code. On Tuesday, 16 August 2016 14:49:32 UTC-3, Md. Ohiduzzaman wrote: > > > > down votefavorite >

How to save one field value from a model to another field of a linked model.

2016-08-16 Thread Md. Ohiduzzaman
I have designed a linked model named Shiftdate as: class Shiftdate(models.Model): shift_date = models.DateField(blank=False,unique=True) sit_date = models.ForeignKey(Sitting, on_delete=models.CASCADE) Using this model I changed sit_date to shift_date which

How to save one field value from a model to another model field

2016-08-16 Thread Md. Ohiduzzaman
down votefavorite I designed two models: one model for storing Sitting date and another mode for storing Shifting date. Two model are linked by foreign key. Here is my two models: class Sitting(models.Model):

How to save multiple image to its associated foreign key object?

2016-03-18 Thread Tushant Khatiwada
I have posted a question in SO but hasnt got any reply yet. Heres the link for my question. Could anyone please help me? http://stackoverflow.com/questions/36001532/multiple-image-not-saved-to-its-foreign-key-object -- You received this message because you are subscribed to the Google Groups

Re: How to save a table in a cell in django models.

2015-12-02 Thread Timothy W. Cook
On Wed, Dec 2, 2015 at 2:27 AM, Billu <billu.man...@gmail.com> wrote: > What I want to do is generate a HTML table (alongwith other data viz. > images, text) when somebody opens a page. > > So how would I *save *a table, i.e, what would be the keyword for it eg. > Ch

How to save a table in a cell in django models.

2015-12-02 Thread Billu
What I want to do is generate a HTML table (alongwith other data viz. images, text) when somebody opens a page. So how would I *save *a table, i.e, what would be the keyword for it eg. CharField, IntegerField. I've googled and people have written that you need to save XML data

Re: How to save data from form FileField to DB Django

2015-07-30 Thread Javier Guerra Giraldez
On Thu, Jul 30, 2015 at 10:40 AM, user07285 wrote: > I have a model and have added a Form FileField to take a file and save all > their contents for a particular object. The FileField doesn't need to be in > the database hence not added as a model.fileField. The content from

How to save data from form FileField to DB Django

2015-07-30 Thread user07285
print(names) form = MoleculeSynonymForm(names) return super(MoleculeSynonymForm, self).save(commit=commit) # class Meta: model = MoleculeSynonym I have two questions:

Re: How to save base64 string in Python django

2015-07-14 Thread Sadaf Noor
If you can avoid saving images to database then the solution would look like following where you are serving base64 url of image to reduce your website data bandwidth: 1. from django.db import models 2. class Photo( models.Model ): 3. title = models.CharField( max_length=255 ) 4.

Re: How to save base64 string in Python django

2015-07-14 Thread Bill Freeman
You don't show where the 'Image' object comes from (in Image.open), so I can't be specific, but here are some generalities: "Incorrect padding" is probably a message from the base 64 decoder. Capture your request.POST[photo] to play with separately. If you are doing this under the development

How to save base64 string in Python django

2015-07-13 Thread ywaghmare5203
Hello all, I am trying to save base64 string string image to database but I am not able to store. I am beginner for python django language. I am following these steps:-- from base64 import b64decode from django.core.files.base import ContentFile from time import time import cStringIO import

Re: How to save user to foreignKey field for new records in modelFormset case?

2015-03-06 Thread Collin Anderson
Hi, The form doesn't have access to the current user. I'd attach it using the view. Thanks, Collin On Wednesday, February 25, 2015 at 3:53:40 AM UTC-5, Mike wrote: > > Hi, > I have created modelFormset using SchoolHistory model and SchoolForm form. > > "SchoolFormSet =

How to save user to foreignKey field for new records in modelFormset case?

2015-02-25 Thread Mike
Hi, I have created modelFormset using SchoolHistory model and SchoolForm form. "SchoolFormSet = modelformset_factory(SchoolHistory, form=SchoolForm)" I get other content from Form, but should save current user to SchoolHistory model too. user=models.ForeignKey(User) school_name =

Re: how to save in inline form total sum

2014-10-29 Thread Collin Anderson
Hello, the only problem that is save correct total sum but a hit 2 o 3 time button > save in the admin, not first time > why? i don't know :( It's probably because ModelA is saved before the individual ModelB's. You could calculate this _after_ the ModelB inlines(?) have been saved using the

Re: how to save in inline form total sum

2014-10-28 Thread carlos
Hi, +Collin i update my ModelA and now is this: class ModelA(models.Model): field1 = charfield(...) field2 = integeterfield() total_men = integerField(editable=False) total_women = integerField(editable=False) def save(self, *args, **kwargs): #this is for sum all 3 data put

Re: how to save in inline form total sum

2014-10-24 Thread carlos
Ok, i try en modelA create the total, thank for idea Cheers On Fri, Oct 24, 2014 at 6:34 AM, Collin Anderson wrote: > Hello, > > >> ModelB in inline >> choice men women >> option1 6 4 >> option2 1

Re: how to save in inline form total sum

2014-10-24 Thread Collin Anderson
Hello, > ModelB in inline > choice men women > option1 6 4 > option2 1 3 > option3 2 1 > > i need save in other field total this sum for example men = 9 and women > total is

Re: how to save in inline form total sum

2014-10-23 Thread carlos
Hi +Collin the idea is sum all data for example de model is class ModelB(models.Model): choice = models.Integerfield(choices='CHOICE_TYPE') men = models.IntegerField() women = models.IntegerField() total_men = integerField(editable=False) total_women =

Re: how to save in inline form total sum

2014-10-23 Thread Collin Anderson
Hello, I'm not sure what you're trying to do, but to fix the None error set default=0 on the total columns. Or do something like this: self.total_men = (self.total_men or 0) + (self.men or 0) Thanks, Collin -- You received this message because you are subscribed to the Google Groups "Django

how to save in inline form total sum

2014-10-21 Thread carlos
Hi, i need sum inlines field but i no have idea example for more clean, i have 2 models in models.py i have: class ModelA(models.Model): field1 = charfield(...) field2 = integeterfield() . CHOICE_TYPE = ((1,"option1"),(2,"option2"),(3,"option3")) class ModelB(models.Model):

how to save manytomany relation data to database through form....

2013-03-02 Thread Iftikhar Ali
i am having one tag class and one user in which user contained a tag element which has manytomany relation with tag class can you guyz tell me how to save this tag using form i attached the form.py model.py and view.py my problem is the tag element i can't access through the form and don't

Re: how to save response 's render file to server or email using httpresponse

2012-07-04 Thread Nikolas Stevenson-Molnar
I stand corrected ;) _Nik On 7/4/2012 8:37 AM, Melvyn Sopacua wrote: > On 3-7-2012 20:32, Nikolas Stevenson-Molnar wrote: >> Oh, and HttpResponse is intended to send data back to a web browser. I >> can't think of any reason you would use an HttpResponse when sending an >> email. > To mail

Re: how to save response 's render file to server or email using httpresponse

2012-07-04 Thread Melvyn Sopacua
On 3-7-2012 20:32, Nikolas Stevenson-Molnar wrote: > Oh, and HttpResponse is intended to send data back to a web browser. I > can't think of any reason you would use an HttpResponse when sending an > email. To mail yourself (parts of) the response object from middleware as part of auditing and/or

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Min Hong Tan
\(^o^)/ On Tue, Jul 3, 2012 at 4:53 PM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > You are welcome. Glad you got it working :) > > _Nik > > > On 7/3/2012 3:33 PM, Min Hong Tan wrote: > > Thx nik, > > I'm confused , your words has aroused me from the word. > "You won't use

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Nikolas Stevenson-Molnar
You are welcome. Glad you got it working :) _Nik On 7/3/2012 3:33 PM, Min Hong Tan wrote: > Thx nik, > > I'm confused , your words has aroused me from the word. > "You won't use HttpResponse at all, just EmailMessage (using > message.attach). " > > problem solved by using below: > > > > from io

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Min Hong Tan
Thx nik, I'm confused , your words has aroused me from the word. "You won't use HttpResponse at all, just EmailMessage (using message.attach). " problem solved by using below: from io import BytesIO buffer = BytesIO() book.save(buffer) excel = buffer.getvalue() buffer.close() and just

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Nikolas Stevenson-Molnar
You'll need to use EmailMessage: https://docs.djangoproject.com/en/dev/topics/email/?from=olddocs/#django.core.mail.EmailMessage You won't use HttpResponse at all, just EmailMessage (using message.attach). _Nik On 7/3/2012 1:34 PM, Min Hong Tan wrote: > sorry all, maybe i'm not type why i need

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Min Hong Tan
sorry all, maybe i'm not type why i need the httpresponse to be attach. response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attaachment; filename=report.pdf' i'm generating the pdf file in response. and normally i will return response and it should be perfect

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Nikolas Stevenson-Molnar
Oh, and HttpResponse is intended to send data back to a web browser. I can't think of any reason you would use an HttpResponse when sending an email. _Nik On 7/3/2012 11:20 AM, Min Hong Tan wrote: > hi, > > I have a problem to send mail using Emailmessage, > i wan to attach the file that render

Re: how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Nikolas Stevenson-Molnar
The content is already rendered when you pass it to your HttpResponse object. Therefore, I would just write it out prior to creating/returning the response object. E.g., if you're using a template: t = get_template("foo.html") c = Context({...}) content = t.render(c) f = open('somefile.txt', 'w')

how to save response 's render file to server or email using httpresponse

2012-07-03 Thread Min Hong Tan
hi, I have a problem to send mail using Emailmessage, i wan to attach the file that render using httpresponse and send, but always show me "int" does not have method "lower". therefore, I think to save the file in the server and then attach using emailmessage. but how do i get the httpresonse to

Re: How to save a file from filesystem

2012-02-06 Thread Martin Tiršel
I found it: myfile = File(open('/some/filesystem/path/file.jpg', 'r')) myfile.name = os.path.basename(myfile.name) myobj = MyObj.objects.get(id=123) myobj.myfile = myfile myobj.save() This saves the file under upload_to path correctly. On Mon, 06 Feb 2012 11:46:19 +0100, Martin Tiršel

How to save a file from filesystem

2012-02-06 Thread Martin Tiršel
Hello, I have a model with FileField with upload_to callable to save it into secific directory structure. I have a list of paths on filesystem with some files I need to create a record for. How can I open a file on the filesystem, assign it to my model and save so the file will be copied

Re: how to save inlines?

2011-08-10 Thread francescortiz
The django documentation about ModelAdmin.save_model seems to be what you look for. The example they give does almost what you want: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model On Aug 8, 11:32 pm, galgal wrote: >

how to save inlines?

2011-08-08 Thread galgal
I need to override save method of inlines in admin. While saving photos, I need to add user id to DB column. I cant make it in model because there is no request data there. How can I do it in admin, to somehow get nad set user id? -- You received this message because you are subscribed to the

Re: How to save multiple model in a transaction?

2011-06-18 Thread bruno desthuilliers
On 18 juin, 13:34, xing wrote: > ex. there are 2 model objects named m1 and m2, I want to save them all > or none,like this: > > #start a transaction > m1.save() > m2.save() > # commit or rollback > > How could I do that in ONE transaction to ensure saved them all or >

How to save multiple model in a transaction?

2011-06-18 Thread xing
ex. there are 2 model objects named m1 and m2, I want to save them all or none,like this: #start a transaction m1.save() m2.save() # commit or rollback How could I do that in ONE transaction to ensure saved them all or none of them? -- You received this message because you are subscribed to

Re: how to save image in postgreSQL database

2011-05-20 Thread Mateusz Marzantowicz
On Fri, May 20, 2011 at 3:00 AM, ramnivas indani wrote: > ok but how can i achieve it in Django means how can i store images in > Django python using URI Read Django documentation (it is part of studying in college): *

Re: how to save image in postgreSQL database

2011-05-19 Thread ramnivas indani
ok but how can i achieve it in Django means how can i store images in Django python using URI -- 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,

Re: how to save image in postgreSQL database

2011-05-19 Thread Simon Connah
On 19 May 2011, at 20:38, ramnivas indani wrote: > ok thanks, is there any online tutorial for that from where i can learn about > URI? This is a good introduction to the subject: http://en.wikipedia.org/wiki/Uniform_Resource_Identifier Simon. -- You received this message because you are

Re: how to save image in postgreSQL database

2011-05-19 Thread Eric Chamberlain
On May 19, 2011, at 6:30 AM, Ram wrote: > hello everyone i am studying python for my college project in which i > am sending some text and image in URL i want to store it to postgreSQL > database i know how to read data from URL but not about images how can > i perform it please help. Storing

Re: how to save image in postgreSQL database

2011-05-19 Thread ramnivas indani
ok thanks, is there any online tutorial for that from where i can learn about URI? -- 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

Re: how to save image in postgreSQL database

2011-05-19 Thread AJ
As Simon mentioned that it is a bad idea and I agree but just for the answer's sake you could save them as BLOBs http://www.postgresql.org/files/documentation/books/aw_pgsql/node96.html Am I correct folks? -AJ On Thu,

Re: how to save image in postgreSQL database

2011-05-19 Thread Simon Connah
On 19 May 2011, at 14:30, Ram wrote: > hello everyone i am studying python for my college project in which i > am sending some text and image in URL i want to store it to postgreSQL > database i know how to read data from URL but not about images how can > i perform it please help. Don't. Save

how to save image in postgreSQL database

2011-05-19 Thread Ram
hello everyone i am studying python for my college project in which i am sending some text and image in URL i want to store it to postgreSQL database i know how to read data from URL but not about images how can i perform it please help. -- You received this message because you are subscribed to

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

2010-12-06 Thread Wayne Smith
> > Thanks, that's fine, but I was wondering if there was a more scalable > way. I have more fields than just "description", so it would be nice > if they could be all saved with one method call, so I don't have to > maintain this code in case I change the model. > > If you have multiple fields

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

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

2010-12-06 Thread Wayne Smith
> 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 provided image.save() By the way, your overridden save() method looks a

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: How to save links in the TextField

2010-05-24 Thread nameless
mmm I could use also javascript or css and render the links on client side ? - On 24 Mag, 14:00, Marcus Carlsson wrote: > A better approach would be just saving the link (not using html markup) > and then apply a filter to those links. This result could

Re: How to save links in the TextField

2010-05-24 Thread Marcus Carlsson
A better approach would be just saving the link (not using html markup) and then apply a filter to those links. This result could later on be cached if performance is an issue. If you later on modify the saved links, just remember to empty the cache. On 24 May 04:55, nameless wrote: > mmm 2

Re: How to save links in the TextField

2010-05-24 Thread nameless
mmm 2 textfields for the same information ? Is this a good approach ? -- On 22 Mag, 20:11, Rolando Espinoza La Fuente wrote: > On Fri, May 21, 2010 at 6:12 PM, nameless wrote: > > > I have a simple Blog model with a TextField. What is the best

Re: How to save links in the TextField

2010-05-22 Thread Rolando Espinoza La Fuente
On Fri, May 21, 2010 at 6:12 PM, nameless wrote: > > > I have a simple Blog model with a TextField. What is the best way to > save links in the TextField ? > > 1) Saving link in the database in this form: http://www.example.com > and then using some filter in the template

  1   2   >