Hi dudes,
Here is an update on this:
Workarround: I removed floppyforms on my Project and use Select2 instead
because it supports searches on foreignkey field and also create an
instance with a form easily.
Template
$(document).ready(function() {
$('#id_medicamento').select2();
});
forms.py
On Feb 6, 10:11 pm, kamilski81 wrote:
> No I am not, once the user is logged in I just want to pull the user
> from there...sort of like this
>
> if request.method == 'POST':
> instance = request.user
> goal = Goal(user=instance)
> form = GoalForm(request.POST, goal)
>
No I am not, once the user is logged in I just want to pull the user
from there...sort of like this
if request.method == 'POST':
instance = request.user
goal = Goal(user=instance)
form = GoalForm(request.POST, goal)
if form.is_valid():
form.save()
On Feb 6, 7:00 pm, kamilski81 wrote:
> Basically I am doing the following:
>
> u=User.objects.get(username="kamilski81")
> goal = Goal(user=u)
> form = GoalForm(request.POST, goal)
>
> and get this error:
>
> (1048, "Column 'user_id' cannot be null")
>
> FROM THE front-end...
>
> Kamil
Are
pm, Dylan Evans wrote:
> user = User.objects.get(username__exact='bob')
> Works fine for me, you may want to try get since it will throw an exception
> if there is no matching user. Then you know the problem is elsewhere.
>
>
>
> On Sat, Feb 6, 2010 at 11:30 AM, kamilski81
, you may want to try get since it will throw an exception
> if there is no matching user. Then you know the problem is elsewhere.
>
>
>
> On Sat, Feb 6, 2010 at 11:30 AM, kamilski81 wrote:
> > I would like to save a form by doing the following:
>
> > #Goal has
user = User.objects.get(username__exact='bob')
Works fine for me, you may want to try get since it will throw an exception
if there is no matching user. Then you know the problem is elsewhere.
On Sat, Feb 6, 2010 at 11:30 AM, kamilski81 wrote:
> I would like to save a form
I would like to save a form by doing the following:
#Goal has a User ForeignKey (django.contrib.auth.models.User)
-
class GoalForm(ModelForm):
class Meta:
model = Goal
---
class Goal(models.Model):
user = models.ForeignKey(User, editable=False)
--
view.py
Thanks for you reply.
But i have this problem i need to check a value from a field before
the validation of the form.
How i can do this.
Sorry for my stupid question but i'm very newbie
On 19 Ago, 19:44, Alex Gaynor wrote:
> On Wed, Aug 19, 2009 at 11:22 AM,luca72 wrote:
>
> > how i can get the
On Wed, Aug 19, 2009 at 11:22 AM, luca72 wrote:
>
> how i can get the value of the fields?
>
> On 19 Ago, 17:45, Daniel Roseman wrote:
>> On Aug 19, 3:40 pm, luca72 wrote:
>>
>> > Iis but form.save don't work
>>
>> That's true.
>> --
>> DR.
> >
>
On a validated form the values will be in the di
how i can get the value of the fields?
On 19 Ago, 17:45, Daniel Roseman wrote:
> On Aug 19, 3:40 pm, luca72 wrote:
>
> > Iis but form.save don't work
>
> That's true.
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
On Aug 19, 3:40 pm, luca72 wrote:
> Iis but form.save don't work
>
That's true.
--
DR.
--~--~-~--~~~---~--~~
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@googlegr
Iis but form.save don't work
On 19 Ago, 16:23, Daniel Roseman wrote:
> On Aug 19, 3:21 pm, luca72 wrote:
>
> > Hello i have a POST form (not modelform) how i can save the data in
> > the db, and if i need to change the data before the save how i can do?
>
> > Thanks
>
> If it's not a modelform,
On Aug 19, 3:21 pm, luca72 wrote:
> Hello i have a POST form (not modelform) how i can save the data in
> the db, and if i need to change the data before the save how i can do?
>
> Thanks
If it's not a modelform, what does it mean to save it in the database?
It's not associated with any model, b
Hello i have a POST form (not modelform) how i can save the data in
the db, and if i need to change the data before the save how i can do?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
15 matches
Mail list logo