Monday, September 30, 2013

Django Consultant/Architect

Hi

We're looking for Django Consultant/Architect who can assist in the assessment of a Python/Django based application. The assessment will involve looking various aspects of architecture, design, and code so the ideal candidate would have the necessary experience to provide a perspective on best practices, pitfalls, design patterns, libraries, frameworks, development tools, etc. for Python/Django. Experience with a platform such as J2EE or .NET would be very beneficial as it would help us and the client compare and contrast Python with more widely adopted enterprise technologies. Also, this person may also need to help train/ramp-up other team members (locally or remote) on Python/Django.

Contact: Vishwas (9986699065)

Vachan.jodalli@gmail.com

Regards

Vishwas

 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/26d8cf71-b906-4243-9f57-517556707edc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[Rails] TypeError: no implicit conversion of Symbol into Hash when submitting form to upload files

I'm currently new to Rails and Ruby and I'm trying to learn from my mistakes, this time I'm trying to upload 2 files from a form for later processing, however, after I hit the "Submit" button. I keep getting this error:

TypeError in UploadFilesController#create

app/controllers/upload_files_controller.rb:28:in `new'  app/controllers/upload_files_controller.rb:28:in `create'

Request

Parameters:

{"utf8"=>"✓",   "authenticity_token"=>"2JJGtRXjWCZlPNhQdx6wOW4xvTseiRaXNylnUYvA5v4=",   "upload_files"=>{"inventory"=>#<ActionDispatch::Http::UploadedFile:0x2fd8940 @original_filename="1_Inventory.xlsx",   @content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",   @headers="Content-Disposition: form-data; name=\"upload_files[inventory]\"; filename=\"1_Inventory.xlsx\"\r\nContent-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\r\n",   @tempfile=#<Tempfile:C:/Users/V80042~1/AppData/Local/Temp/RackMultipart20130930-9236-qiqijn>>,   "material_list"=>#<ActionDispatch::Http::UploadedFile:0x2fe3cf8 @original_filename="2_Material_List.xlsx",   @content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",   @headers="Content-Disposition: form-data; name=\"upload_files[material_list]\"; filename=\"2_Material_List.xlsx\"\r\nContent-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\r\n",   @tempfile=#<Tempfile:C:/Users/V80042~1/AppData/Local/Temp/RackMultipart20130930-9236-g22588>>},   "commit"=>"Upload"}

My upload_files_controller:

 class UploadFilesController < ApplicationController       def new          @uploadFiles = UploadFiles.new  end      def create      @uploadFiles = UploadFiles.new(params[:upload_files])  end

Models:

Upload_Files:

class UploadFiles < ActiveRecord::Base    attr_accessible :inventory, :material_list    has_one :inventory    has_one :material_list    has_attached_file :inventory, :material_list      def new      {        "name" => read_attribute(:upload_file_name),        "size" => read_attribute(:upload_file_size),        "url" => upload_file.url(:original),        "delete_url" => upload_file_path(self),        "delete_type" => "DELETE"         }    end  end

Inventory:

class Inventory < ActiveRecord::Base    belongs_to :upload_files  end

Material List:

class MaterialList < ActiveRecord::Base    belongs_to :upload_files  end

_form:

<%= form_for :upload_files do |f| %>  <h3>Upload Inventory</h3>  <%= f.file_field :inventory %>  <h3>Upload Product List</h3>  <%= f.file_field :material_list %>  <div class="actions">      <%= f.submit "Upload" %>  </div>  <% end %>

Could you please tell me what am I doing wrong and how to fix it? Thank you in advance.


Note: In case you haven't noticed, I'm using paperclip and rails 3.x.x

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1197451b-7c77-48fe-96ea-45783058f468%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Multiple versions of Django

Yes, use something like VirtualEnv, it allows you to separate website environments and requirements and it has nice additionals to help you publish


On Mon, Sep 30, 2013 at 10:25 AM, Jasvir Singh <jassigrewal91@gmail.com> wrote:
Is it possible to install multiple versions of Django on single ubuntu server.
If yes, please tell me how to do this.
I have already made a try for this using virtual environment, but
found that it is only for development.

--

Jasvir Singh Grewal
Blog:http://jasvirsinghgrewal91.wordpress.com/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

geraldklein.wordpress.com

jk@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580 

Brought to you by the Amish Mafia

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP8NtCxFLYQ795ZyzHbHumNH9uDpf-MUET7PbxwyA%3DXVovo9pw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Multiple versions of Django

Is it possible to install multiple versions of Django on single ubuntu server.
If yes, please tell me how to do this.
I have already made a try for this using virtual environment, but
found that it is only for development.

--

Jasvir Singh Grewal
Blog:http://jasvirsinghgrewal91.wordpress.com/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN_O85vhiKvpdxf74stvfR1AsLcoP6E1EeC1M86nHgFRF34K1g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: [Rails] Checkbox help ;)

Have a look at this page, at the "gotcha" around multiple => true.

http://apidock.com/rails/ActionView/Helpers/FormHelper/check_box#note_info-1001

Walter

On Sep 30, 2013, at 7:16 AM, Jon Goodey wrote:

> A quick question I have working with a object in a rails 3 app and I
> would like to retain the checkboxes ticked (for example there are 3
> options if someone chooses option 1 and 2 and refreshes the page the
> checkboxes 1 and 2 will remain ticked), this is very easy with radio
> buttons but I am still trying to get my head around it with checkboxes.
>
> here is some code:
>
> <%= form_for(@user, :remote => true) do |f| %>
>
> <%= f.check_box :a1, {:multiple => true}, "1", "" %>
> <%= f.check_box :a1, {:multiple => true}, "2", "" %>
> <%= f.check_box :a1, {:multiple => true}, "3", "" %>
> <%= f.submit %>
> <% end %>
> <%= @user.a1.inspect %>
> output from the inspect element:
>
> "---\n- ''\n- '1'\n- ''\n- '2'\n- ''\n"
> the user model has the a1 as a string in the db.
>
> thanks in advance if anyone can help ,e
>
> Regards Jon
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/27339ce1b51bc7c4bf4563d4f4206107%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5B138B0B-F545-4E5D-B093-73EC7EC5D5C2%40wdstudio.com.
For more options, visit https://groups.google.com/groups/opt_out.

3akarat.com - شاليه بقرية ساند بيتش بالعين السخنة

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: Textarea and initial value

On Monday, 30 September 2013 15:41:47 UTC+1, Marcin Szamotulski wrote:

I don't do anything odd: I simply modify it by typing in side textarea.
The page has a very simple JavaScript which does not do anything with
the textarea (though I double-checked that turning it off does not
improve the situation).  Inspecting the request reveals that the data is
indeed submitted twice (thus django correctly interpret the situation).

The form is using enctype='multipart/form-data' since it is also used to
submit a file, though leaving only the textarea inside the form and
removing the enctype does not help.

I also checked this in both firefox and chrome and both show that the
POST data for this textarea is submitted twice.

Any ideas?

Thanks for help,
Marcin

Can you perhaps post the template fragment that renders the field, and also the rendered HTML?
--
DR. 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/045cca12-7ec5-4d29-bc6c-4a601eff5996%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Re: Widevine Adaptive Streaming

Ahoj Honza,

Yes - sorry for not posting an eventual resolution here.

For me, the simple change that made it work was replacing "http://"
with "widevine://" in the URL to stream.

So instead of "http://blah.com/foo.wmv", try "widevine://blah.com/foo.wmv".

Larry

On Mon, Sep 30, 2013 at 8:40 AM, Hoa Quoc Tran <traninho90@gmail.com> wrote:
> Hi,
>
> I am also stucked with this. I am using DRM and widevine with videoview.
>
> On Samsung S4 4.2.2: video seems to have good quality, but If I seek into
> different position then video will have bad quality.
> On Samsung TAB 2 10" 4.0.3: video starts in poor quality, never get better
> quality
> On Samsung Tab 3 8" 4.2.2: video starts in good quality, but if I seek into
> different position then video will stop playback with error.
>
>
> did you resolve this somehow?
>
> Thanks,
> Honza.
>
> Dne čtvrtek, 17. ledna 2013 23:24:23 UTC+1 Larry Meadors napsal(a):
>>
>> Crap, this appears to vary by device.
>>
>> On a Samsung Galaxy Tab 8.9, it's perfect. This is running 3.2.
>>
>> On a Nexus 7, it's crap. This is running 4.1.2.
>>
>> On a Samsung Galaxy S2 Skyrocket running 4.0.4, it's hit and miss.
>>
>> Larry
>>
>>
>> On Thu, Jan 17, 2013 at 5:37 AM, Larry Meadors <larry....@gmail.com>
>> wrote:
>> > I'm using the built-in DRM support for widevine video playback, and
>> > the video quality seems really poor.
>> >
>> > The same video played on an ios device or using their web player seems
>> > fine, but on android it's super blocky.
>> >
>> > Is anyone here familiar with this problem?
>> >
>> > Larry
>> >
>> >
>> > PS: Yes, I know it's not EXCLUSIVELY android development. But it is
>> > exclusively an android (and widevine) issue.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: GWT Chat applications

I used get-eventservice to build a custom solution. 
Requirements were for system to client and client to client messaging. Uses one of the two RPC connections most browsers allow JS.
So far working well.

Tim

On Sep 30, 2013, at 11:03 AM, David Levesque <dlevesque@primalogik.com> wrote:

I have built a chat front-end using GWT, Strophe.js and gwt-strophe (bindings for GWT). Strophe simulates persistent XMPP connections through BOSH. For the server I used Tigase, but it should work with any XMPP complient server. There are many good open source chat servers that allow you to write custom plugins in java (e.g. for authentication and integration with your back-end). Openfire is a popular one.

The advantage of having a separate chat server is that it removes a lot of load (and at lot of long lived connections) from your servlet container. The drawback is that it makes integration with your webapp harder, because you have to write plugins to talk to your backend. But imo it scales better, especially if you're going to have hundreds or thousands of simultaneous chat users.

Basically my GWT app uses GWT-RPC to talk to Tomcat, but the chat stuff does not go to Tomcat. It goes to the standalone Tigase server living on the same machine. All traffic go through port 80 (or 443) and it is routed to either Tomcat or Tigase using reverse proxy rules in Apache Web server.

Unfortunately I can't show you the code or point you to a live example because it was developped for a company I worked for (closed source) and the application is not open to public.

--
David


On Wednesday, December 9, 2009 7:13:16 AM UTC-5, abhiram wrote:
Hi All,

   Can someone tell me which is the best (and convenient) method to
implement a chat application for my web page using GWT?

  I believed using the comet.jar would be neat but had lot of problem
implementin it. Can you please tell me which is the best possible
approach? with any working examples / links?

~ Abhiram

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Re: GWT Chat applications

I have built a chat front-end using GWT, Strophe.js and gwt-strophe (bindings for GWT). Strophe simulates persistent XMPP connections through BOSH. For the server I used Tigase, but it should work with any XMPP complient server. There are many good open source chat servers that allow you to write custom plugins in java (e.g. for authentication and integration with your back-end). Openfire is a popular one.

The advantage of having a separate chat server is that it removes a lot of load (and at lot of long lived connections) from your servlet container. The drawback is that it makes integration with your webapp harder, because you have to write plugins to talk to your backend. But imo it scales better, especially if you're going to have hundreds or thousands of simultaneous chat users.

Basically my GWT app uses GWT-RPC to talk to Tomcat, but the chat stuff does not go to Tomcat. It goes to the standalone Tigase server living on the same machine. All traffic go through port 80 (or 443) and it is routed to either Tomcat or Tigase using reverse proxy rules in Apache Web server.

Unfortunately I can't show you the code or point you to a live example because it was developped for a company I worked for (closed source) and the application is not open to public.

--
David


On Wednesday, December 9, 2009 7:13:16 AM UTC-5, abhiram wrote:
Hi All,

   Can someone tell me which is the best (and convenient) method to
implement a chat application for my web page using GWT?

  I believed using the comet.jar would be neat but had lot of problem
implementin it. Can you please tell me which is the best possible
approach? with any working examples / links?

~ Abhiram

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

xadmin override base_site.html

Hi,

has someboday a clue why I get this error.
Without the modifications xadmin works fine, but if  I copy  for modifications in my ../templates/xadmin/base_site.html
I got the error below.

If I cut this *if step*  the template is loaded but without surprise in fragile form. Has anybody an idea where this menu_template
comes from , can't find it yet?  With the complete  template/xadmin folder in my ../templatesthe problem is still the same.

Thanks Christian

TemplateDoesNotExist at /admin
No exception supplied
Request Method: GET
Request URL: http://localhost:8000/admin
Django Version: 1.5.4
Exception Type: TemplateDoesNotExist
Exception Location: /home/chris/.local/lib/python2.7/site-packages/django/template/loader.py in find_template, line 139



31 <div id="body-content" class="clearfix row">
32 <div id="left-side" class="col-sm-1 col-md-2">
33 {% block navbar %}
34 {% if nav_menu %}
35 {% include menu_template %}
36 {% else %}
37 <p>{% trans "You don't have permission to edit anything." %}</p>
38 {% endif %}
39 {% endblock %}
40 </div>


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5ca8f889-7d16-487c-9d92-ae9afc3db383%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Django South - SyntaxError: invalid syntax (, line 1)

Hi.... 

I'm having trouble with the South.

In the model below:

class Carrier (models.Model):
     name = models.CharField (max_length = 40, blank = False, null = False, verbose_name = 'Name')
     user = models.ForeignKey (User, blank = True, null = True)
    
     def save (self, force_insert = False, force_update = False):
         self.nome self.nome.upper = ()
         super (Carrier, self). save (force_insert, force_update)
        
     def __ unicode__ (self):
         return u '% s'% (self.nome)

the error occurs when i run the migrate after South on the app.
SyntaxError: invalid syntax (<string>, line 1)

But if my model does not have the user field, then the error message does not occur, as shown below:

class Carrier (models.Model):
     name = models.CharField (max_length = 40, blank = False, null = False, verbose_name = 'Name')
    
     def save (self, force_insert = False, force_update = False):
         self.nome self.nome.upper = ()
         super (Carrier, self). save (force_insert, force_update)
        
     def __ unicode__ (self):
         return u '% s'% (self.nome)


I need the field User. What I have to do ?

Thanks a lot.

Ivan 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/45f2764c-c903-41c2-b692-2afb9f9332ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to relate table with one of many others?

Thank you

On Monday, September 30, 2013 5:39:42 PM UTC+3, Jeremy Burns wrote:
Cake won't/can't but your code can make it happen.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:55:01, Kemal <ahmetke...@gmail.com> wrote:

I am using Mysql Workbench and it forces plural names. I will fix them. Will cakephp decide whether it is a domain or a hosting looking by order_type_id?

On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
Scrub that - I see there is an orders_id field on hostings and domains. Sorry. However, some of your fields have incorrect names:

  • domains->orders_id ought to be 'order_id'
  • hostings->orders_id ought to be 'order_id'
  • orders->orders_types_id ought to order_type_id
  • clients_bills table name ought to be client_bills
  • client_bills->clients_id ought to be client_id

I note that you have both clients_id and client_id on the orders table. I'm assuming that one would be the id used by the client? If so, the joining field will be order_id. I'd consider renaming orders_id to something that doesn't end in _id as Cake will try to find a related table and build an association with it; perhaps client_reference would be better?

If you made those changes you could get your basic models built using cake bake.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit <jerem...@classoutfit.com> wrote:

Surely there would be a 1->many relationship between:
  • orders_types (which ought to be called order_types) and orders
  • domains to orders
  • hostings to orders?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:05:18, Kemal <ahmetke...@gmail.com> wrote:

Hello,

I have created a topic on stackoverflow but didn't get attention. So...

I am little confused about my db design. I have orders table that may have records from one of many others. So is it OK to relate each tables with 1:1 to orders. Please look at orders domains andhostings table relations.

My orders table rows has either a domain or hosting regarding to its orders_type value. There will be more than 10 products like domains, hostings etc. So creating a column on orders table for each product would not be a good practice.

What is the best way to build my structure for CakePhp?



--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Textarea and initial value

On 06:38 Mon 30 Sep , Daniel Roseman wrote:
> On Sunday, 29 September 2013 22:58:38 UTC+1, Marcin Szamotulski wrote:
>
> > Dear Django users,
> >
> > The short question is: How to use Textarea widget with initial value?
> > The long version: I have a form with a simple Textarea widget
> >
> > class Form(forms.Form):
> >
> > f = forms.CharField(widget=forms.Textarea())
> >
> > in a view I set an initial value:
> >
> > form = Form(initial={'f': 'initial value})
> >
> > and it renders on a page as
> > <textarea>intial value</textarea>
> >
> >
> > Then let say I modify the initial value to 'new value'
> >
> > Then when I POST the form (i.e. send a POST request). The
> > request.POST.getlist('f')
> > returns
> > ['new value', 'intial value']
> > and since the 'initial value' is after the 'new value' when I intialise
> > the form
> > form = Form(request.POST)
> > it has form.cleaned_data['f'] == 'initial value'.
> >
> > What is the correct way to make initial value in a textarea so that it
> > is not submitted with the form.
> >
> > Playing with this I tried to remove the 'initial value' using javascript
> > ($('textarea[name="f"]).html('')), but the submitted date (request.POST)
> > was not affected.
> >
> > Thanks for help,
> > Marcin
> >
>
> How are you "modifying the initial value to 'new value' "? If you're simply
> typing in the field to replace the text that's there, there's no way that
> request.POST can contain the original data. You seem to be doing something
> odd somewhere.
> --
> DR.

I don't do anything odd: I simply modify it by typing in side textarea.
The page has a very simple JavaScript which does not do anything with
the textarea (though I double-checked that turning it off does not
improve the situation). Inspecting the request reveals that the data is
indeed submitted twice (thus django correctly interpret the situation).

The form is using enctype='multipart/form-data' since it is also used to
submit a file, though leaving only the textarea inside the form and
removing the enctype does not help.

I also checked this in both firefox and chrome and both show that the
POST data for this textarea is submitted twice.

Any ideas?

Thanks for help,
Marcin

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20130930144147.GG27988%40flying-circus.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to relate table with one of many others?

Cake won't/can't but your code can make it happen.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:55:01, Kemal <ahmetkemalarik@gmail.com> wrote:

I am using Mysql Workbench and it forces plural names. I will fix them. Will cakephp decide whether it is a domain or a hosting looking by order_type_id?

On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
Scrub that - I see there is an orders_id field on hostings and domains. Sorry. However, some of your fields have incorrect names:

  • domains->orders_id ought to be 'order_id'
  • hostings->orders_id ought to be 'order_id'
  • orders->orders_types_id ought to order_type_id
  • clients_bills table name ought to be client_bills
  • client_bills->clients_id ought to be client_id

I note that you have both clients_id and client_id on the orders table. I'm assuming that one would be the id used by the client? If so, the joining field will be order_id. I'd consider renaming orders_id to something that doesn't end in _id as Cake will try to find a related table and build an association with it; perhaps client_reference would be better?

If you made those changes you could get your basic models built using cake bake.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit <jerem...@classoutfit.com> wrote:

Surely there would be a 1->many relationship between:
  • orders_types (which ought to be called order_types) and orders
  • domains to orders
  • hostings to orders?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:05:18, Kemal <ahmetke...@gmail.com> wrote:

Hello,

I have created a topic on stackoverflow but didn't get attention. So...

I am little confused about my db design. I have orders table that may have records from one of many others. So is it OK to relate each tables with 1:1 to orders. Please look at orders domains andhostings table relations.

My orders table rows has either a domain or hosting regarding to its orders_type value. There will be more than 10 products like domains, hostings etc. So creating a column on orders table for each product would not be a good practice.

What is the best way to build my structure for CakePhp?



--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

3akarat.com - فرصه للسكن والشركات للايجارشقة قانون جديد 240م بموقع مميز منمدينة نصر

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - فرصه لاتتكرر للايجارشقة قانون جديد 140م بموقع مميز بجوار النادي الاهلي مدينة نصر

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - فرصه للشركات والمقرات الاداريه للايجار مكتب مفروش واجهه على طريق النصر الرئيسي

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: Creating multiple objects at once

well, you can always write the raw SQL querie...
https://docs.djangoproject.com/en/1.4/topics/db/sql/

On Sunday, September 29, 2013 10:16:47 PM UTC-5, Lachlan Musicman wrote:
Hola,

I have a inventory system with Parts and Part types. Part Types are
Archetypes, parts are instances of Part Types with details (unit cost,
serial number, date of purchase, etc).

A big issue is that not all Parts have serial numbers (box of 1000
screws for instance). But when we get a large quantity of parts that I
would like to apply serial numbers to, data entry staff don't want to
enter the otherwise identical data again and again.

Since most serialised products we are storing come with numbers that
are "in serial", I want to replace the creation process with a form
that also asks for "first serial number" and "number of parts" -
giving a nice list of easily incremented serial numbers. Then we can
create the requisite objects at the same time, and save them with just
the diff serial.

What is the best way to do this?

I've seen three solutions so far:

1. bulk_create https://docs.djangoproject.com/en/1.4/ref/models/querysets/#bulk-create
problem: doesn't call model save method (in my case, where the slug is
populated from the id).

2. transaction.commit_manually
https://docs.djangoproject.com/en/dev/topics/db/transactions/#django.db.transaction.commit_manually

3. Signals https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save
(and now that I think about it, probably transaction.commit_manually
coupled with it).

What does the list recommend as a method?

Also, as I discovered in the IRC the other day, there really is a time
when CBVs aren't appropriate. Should this process be a CBV - it seems
a lot more suited to a FBV.

Cheers
L.


--
Maya Otos (@maya_otos) tweeted at 9:27 PM on Tue, Jul 30, 2013:
When you used to be punk, and now you are still punk but not as punk,
are you post-punk or decaying punk or ex-punk or just not punk anymore

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f166ff7b-f449-47b1-add8-05d07759f9b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Real Estate