Parse.com: with parseUser, how can I save data in a column I created in parse from the class?
Tag : java , By : algoRhythm99
Date : March 29 2020, 07:55 AM
I wish this help you Yes, Parse does provide methods to save username, passwords like setUsername(params) and setPassword(params) but if you want to add more data to the tables, you can create more columns according to your needs as I did in this code snippet. If you have come columns created already in parse back-end like name, phone,address,cityState,companyId, this is how I am doing it. private void savetoParse() {
ParseUser user = new ParseUser();
user.setUsername(usernameEditText.getText().toString());
user.setPassword(passEditText.getText().toString());
user.put("name", nameEditText.getText().toString());
user.setEmail(emailEditText.getText().toString());
user.put("phone", phoneNoEditText.getText().toString());
user.put("address", addressEditText.getText().toString());
user.put("cityState", cityStateEditText.getText().toString());
user.put("companyID", compSchoolIdEditText.getText().toString());
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e != null) {
Toast.makeText(SignupActivityUpdate.this,
"Saving user failed.", Toast.LENGTH_SHORT).show();
Log.w(TAG,
"Error : " + e.getMessage() + ":::" + e.getCode());
if (e.getCode() == 202) {
Toast.makeText(
SignupActivityUpdate.this,
"Username already taken. \n Please choose another username.",
Toast.LENGTH_LONG).show();
usernameEditText.setText("");
passEditText.setText("");
confirmPassEditText.setText("");
}
} else {
Toast.makeText(SignupActivityUpdate.this, "User Saved",
Toast.LENGTH_SHORT).show();
/*Do some things here if you want to.*/
}
}
});
|
Transferring Data between view controllers. While loading data from Parse. Data is transferred before Parse Query Popula
Tag : ios , By : Lathentar
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I know how to transfer data between view controllers, but the data is being transferred before I am able to complete a parse query therefore the data is missing when the data is transferred between view controllers. The code I am using is as follows. with the first part related to the parse query and the last section detailing the sending of data. How can I get it so that the Data is successfully stored in phoneNUMBERS before it is passed to the new view? Because at the moment is is passed as NULL. , Yo need to put this part of code ContactTableViewController *contacts = [[ContactTableViewController alloc]initWithNibName:Nil bundle:Nil];
contacts.user = usernamecontrol;
contacts.PHONENUMBERS = phoneNUMBERS;
[self presentViewController:contacts animated:YES completion:Nil];
// Do something with the found objects
|
Querying a Parse database to get the data from one single column within a Parse data Class
Date : March 29 2020, 07:55 AM
help you fix your problem Hello , From the Parse API ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
query.selectKeys(Arrays.asList("playerName", "score"));
List<ParseObject> results = query.find();
ParseQuery<ParseObject> query = ParseQuery.getQuery("Posts");
query.selectKeys(Arrays.asList("text"));
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> posts, ParseException e) {
if (e == null) {
List<String> postTexts = new ArrayList<String>();
for(ParseObject post : posts){
postTexts.add(post.getString("text"));
}
Toast.makeText(MainActivity.this, postTexts.toString(), Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(MainActivity.this, "query error: " + e, Toast.LENGTH_LONG).show();
}
}
});
|
Scrapy parse list of urls, open one by one and parse additional data
Date : March 29 2020, 07:55 AM
Hope that helps The AJAX requests you are simulating are caught by the Scrapy "duplicate url filter". Set dont_filter to True when yielding a Request: yield Request(url=item['url'],
meta={'item': item},
callback=self.parse_additional_info,
dont_filter=True)
|
Parse - Android - Will an exception be caused if no data is returned on a Parse query?
Date : October 29 2020, 04:45 AM
This might help you If you follow the code from ParseQuery: public Task<List<T>> findInBackground() {
return findAsync(builder.build());
}
// Converts the JSONArray that represents the results of a find command to an
// ArrayList<ParseObject>.
/* package */ <T extends ParseObject> List<T> convertFindResponse(ParseQuery.State<T> state,
JSONObject response) throws JSONException {
ArrayList<T> answer = new ArrayList<>();
JSONArray results = response.getJSONArray("results");
if (results == null) {
PLog.d(TAG, "null results in find response");
} else {
String resultClassName = response.optString("className", null);
if (resultClassName == null) {
resultClassName = state.className();
}
for (int i = 0; i < results.length(); ++i) {
JSONObject data = results.getJSONObject(i);
T object = ParseObject.fromJSON(data, resultClassName, state.selectedKeys() == null);
answer.add(object);
/*
* If there was a $relatedTo constraint on the query, then add any results to the list of
* known objects in the relation for offline caching
*/
ParseQuery.RelationConstraint relation =
(ParseQuery.RelationConstraint) state.constraints().get("$relatedTo");
if (relation != null) {
relation.getRelation().addKnownObject(object);
}
}
}
return answer;
}
|