the mothed is :
def printa(x):
return x
the reponse is :
self.response.out.write(template.render(path, {'printa':printa}))
the html is :
{{ printa 'sss'}}
i want to show 'sss' in my page ,
so how to do this ,
thanks
updated
i create a templatetags folder, and 2 py file:
templatetags
|--------__init__.py
|---...
the model is :
class someModel(db.Model):
name = db.StringProperty()
def name_is_sss(self):
return self.name=='sss'
the view is :
a=someModel()
a.name='sss'
path = os.path.join(os.path.dirname(__file__), os.path.join('templates', 'blog/a.html'))
self.response.out.write(template.render(path, {'a':a}))
...
Hi all
I am trying to build a PHP class to check the username and password in MySql.
I am getting "mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\2010Portfolio\football\main.php on line 38" database has errors:" message.
When I move my userQuery code out of my Class, it works fine. Only if it is inside my C...
Hi.
Is there any fast way to verify null arguments
via attributes or something?
Convert this:
public void Method(type arg1,type arg2,type arg3)
{
if (arg1== null) throw new ArgumentNullException("arg1");
if (arg2== null) throw new ArgumentNullException("arg2");
if (arg3== null) throw new ArgumentNullException("arg3");
...
Hello
I'm developing an android application .. which will send location data to a web service to store in the server database.
In Java:
I've used this protocol so the URI is: HTTP request instead of REST
HttpPost request = new HttpPost("http://trafficmapsa.com/GService.asmx/GPSdata? lon="+Lon+"&Lat="+Lat+"&speed="+speed);
In A...
Hello, I just hit a situation where a method dispatch was ambiguous and wondered if anyone could explain on what basis the compiler (.NET 4.0.30319) chooses what overload to call
interface IfaceA
{
}
interface IfaceB<T>
{
void Add(IfaceA a);
T Add(T t);
}
class ConcreteA : IfaceA
{
}
class abstract BaseClassB<T> : IfaceB<T>...
Possible Duplicate:
Why can templates only be implemented in the header file??
Hi,
I have a c++ project which consists of several header and source files. In order to modify the class with a template, I found that all the method definitions must be included in the header file itself, else resulting in a link-time error. What ...
Hey,
here is a quick question,
i have my couple view controllers classes, and have some other classes.
i've found my self creating some methods in all of their implementation files, which are doing the same.
i would like to write some of my methods in a seperate file,
and import this file into my view controllers.
therefore, i will be ...
Hi,
I'm kind of stuck with this pretty simple (I'm sure) jQuery/Javascript issue.
Here's the code :
jQuery.validator.addMethod("emailExists", function(value, element, param) {
var email = value || '';
var valid = 0;
$.ajax({
type: "POST",
url: param,
data: "email=" + email,
success: function(msg) {
if (msg != '' ...
For example, if you want information of PHP functions, you can go to http://www.php.net/ . If you want information of Perl functions you can to to http://www.cpan.org/ and/or use perldoc. If you want information on Java you can go to http://java.sun.com and/or use javadoc. However, if you want information on Javascript methods/functions ...
Hey,
I have created a Class (subclass of NSObject) which will hold all my SQLs/dbConnections etc..
in a seperate viewcontroller, i have instantiated the SQL's class and performed some actions, all went trough OK.
but.
one of my methods in the SQL's class is a method defined as follows:
-(NSString *)queryTable:(NSUInteger *)fieldnum
...
I've set up an abstract parent class, and a concrete class which extends it. Why can the parent class not call the abstract function?
//foo.php
<?php
abstract class AbstractFoo{
abstract public static function foo();
public static function getFoo(){
return self::foo();//line 5
}
}
class C...
I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction it...
Hi
Is there a way in MBUnit to have the same test called multiple times with different parameters in a sequence, as such:
Method1()
Method2(param A)
Method3()
Method2(ParamB)
Method4()
Method2(ParamC)
etc? I've tried using the Order parameter but sadly I was too hopeful in that the Ordering would be considered class-wide rather than t...
If I have a parameter passed to a method, do I need to release the parameter at the end of the method?
...
Here's my class definition:
class A {
public:
void do_lengthy_work() {
cout << "working." << endl;
}
};
I have an object of type A, and I want to call do_lengthy_work() on it:
A a;
a.do_lengthy_work();
Is it also possible to call the same method using some variant of the following?
A::do_lengthy_work(a)...
I have a C# WPF app that every time the user opens a new file, the contents are displayed in a datagrid.
public partial class MainWindow : Window
{
public TabControl tc = new TabControl();
public MainWindow()
{
InitializeComponents();
}
private FromFile_click(object sender, RoutedEventArgs e)
{
...
Hello,
I'm trying to implement method chaining in C++, which turns out to be quite easy if the constructor call of a class is a separate statement, e.g:
Foo foo;
foo.bar().baz();
But as soon as the constructor call becomes part of the method chain, the compiler complains about expecting ";" in place of "." immediately after the cons...
Hi again :)
I think subject tells everything ...
I need this method only. No need to waste about 6Mb of included unit if only thing I need is one method from that unit ( Themes ) ...
I was thinking of UxTheme unit, but it did not contain proper function. What Windows DLL do I need to import and what API function this method stands for...
How can we call a method which name is string at runtime. Can anyone show me how to do that in Java and C.
Thanks for replying.
...